Commit eb9bf93c authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

init

parents
Pipeline #819 canceled with stages
.idea
*.iml
out
gen
*.sol
*.txt
.DS_Store
*.exe
build
\ No newline at end of file
FROM golang:1.21-alpine AS builder
WORKDIR /app
COPY . .
RUN go mod tidy && go build -v -o /tmp/sync ./cmd/sync
FROM alpine:latest
WORKDIR /app
COPY ./config.toml .
COPY --from=builder /tmp/sync /usr/bin/sync
EXPOSE 8080
\ No newline at end of file
.PHONY: default all clean dev messenger
GOBIN = $(shell pwd)/build/bin
default: all
all: api
api:
go build $(BUILD_FLAGS) -v -o=${GOBIN}/$@ ./cmd/api
docker:
docker build -t caduceus/pump:latest -f Dockerfile .
push:
docker push caduceus/pump:latest
\ No newline at end of file
package chain
import (
"pump/constant"
"pump/contract/bonding"
dbModel "pump/model/db"
"pump/util"
"strings"
"github.com/ethereum/go-ethereum/core/types"
"github.com/shopspring/decimal"
log "github.com/sirupsen/logrus"
)
func (s *Sync) FilterLaunch(txLog types.Log) {
if len(txLog.Topics) == 0 {
return
}
abi, _ := bonding.BondingMetaData.GetAbi()
if txLog.Topics[0].Hex() != abi.Events["Launched"].ID.Hex() {
return
}
launchEvent, err := s.bondingCa.ParseLaunched(txLog)
if err != nil {
log.WithError(err).Error("parse launch log")
return
}
newToken := launchEvent.Token.Hex()
tokenInfo, err := s.d.GetTokenInfo(newToken)
if err != nil {
log.WithField("token", newToken).WithError(err).Error("get token info")
return
}
token := &dbModel.Token{
Creator: strings.ToLower(tokenInfo.Creator.Hex()),
Token: strings.ToLower(tokenInfo.Token.Hex()),
NFTAddress: strings.ToLower(tokenInfo.NftAddress.Hex()),
Pair: strings.ToLower(tokenInfo.Pair.Hex()),
Ticker: tokenInfo.Data.Ticker,
Name: tokenInfo.Data.Name,
Supply: decimal.NewFromBigInt(tokenInfo.Data.Supply, 0),
Description: tokenInfo.Description,
Image: tokenInfo.Image,
Twitter: tokenInfo.Twitter,
Website: tokenInfo.Website,
Telegram: tokenInfo.Telegram,
Graduated: false,
Price: decimal.NewFromBigInt(tokenInfo.Data.Price, 0),
MarketCap: decimal.NewFromBigInt(tokenInfo.Data.MarketCap, 0),
Volume: decimal.NewFromBigInt(tokenInfo.Data.Volume, 0),
Volume24H: decimal.NewFromBigInt(tokenInfo.Data.Volume24H, 0),
Reserve0: decimal.NewFromBigInt(constant.TokenSupply, 0),
Reserve1: decimal.NewFromBigInt(constant.AssetSupply, 0),
TxHash: txLog.TxHash.Hex(),
BlockNumber: int(txLog.BlockNumber),
BlockTime: util.BlockToTimestamp(int(txLog.BlockNumber)),
}
err = s.d.CreateToken(token)
if err != nil {
log.WithError(err).Error("create agent token")
return
}
log.WithFields(log.Fields{
"creator": tokenInfo.Creator.Hex(),
"token": tokenInfo.Token.Hex(),
"tx": txLog.TxHash.Hex(),
}).Info("launch success")
}
func (s *Sync) FilterGraduate(txLog types.Log) {
if len(txLog.Topics) == 0 {
return
}
abi, _ := bonding.BondingMetaData.GetAbi()
if txLog.Topics[0].Hex() != abi.Events["Graduated"].ID.Hex() {
return
}
graduateEvent, err := s.bondingCa.ParseGraduated(txLog)
if err != nil {
log.WithError(err).Error("parse graduate log")
return
}
err = s.d.GraduateToken(graduateEvent.Token.Hex(), txLog.TxHash.Hex(), graduateEvent.Univ2Pair.Hex())
if err != nil {
log.WithError(err).Error("graduate agent token")
return
}
log.WithFields(log.Fields{
"token": graduateEvent.Token.Hex(),
"tx": txLog.TxHash.Hex(),
"univ2pair": graduateEvent.Univ2Pair.Hex(),
}).Info("graduate success")
}
func (s *Sync) FilterSwap(txLog types.Log) {
if len(txLog.Topics) == 0 {
return
}
abi, _ := bonding.BondingMetaData.GetAbi()
if txLog.Topics[0].Hex() != abi.Events["Swap"].ID.Hex() {
return
}
swapEvent, err := s.bondingCa.ParseSwap(txLog)
if err != nil {
log.WithError(err).Error("parse swap log")
return
}
buy := true
amountIn, amountOut := swapEvent.Amount1In, swapEvent.Amount0Out // eth增加, token减少
assetAmount, TokenAmount := decimal.NewFromBigInt(amountIn, 0), decimal.NewFromBigInt(amountOut, 0)
if swapEvent.Amount1In.String() == "0" {
buy = false
amountIn, amountOut = swapEvent.Amount0In, swapEvent.Amount1Out // eth减少, token增加
assetAmount, TokenAmount = decimal.NewFromBigInt(amountOut, 0), decimal.NewFromBigInt(amountIn, 0)
}
price := assetAmount.DivRound(TokenAmount, 18)
// priceWei := assetAmount.Div(TokenAmount).Mul(decimal.NewFromInt(1000000000000000000))
// eth单位
amountInETH := decimal.NewFromBigInt(amountIn, 0).DivRound(decimal.NewFromInt(1000000000000000000), 18)
amountOutETH := decimal.NewFromBigInt(amountOut, 0).DivRound(decimal.NewFromInt(1000000000000000000), 18)
tradeHistory := &dbModel.TradeHistory{
FromAddress: strings.ToLower(swapEvent.Sender.Hex()),
Token: strings.ToLower(swapEvent.Token.Hex()),
AmountIn: amountInETH,
AmountOut: amountOutETH,
Price: price,
IsBuy: buy,
TxHash: txLog.TxHash.Hex(),
LogIndex: int(txLog.Index),
BlockTime: util.BlockToTimestamp(int(txLog.BlockNumber)),
BlockNumber: int(txLog.BlockNumber),
}
err = s.d.CreateTradeHistory(tradeHistory)
if err != nil {
log.WithError(err).Error("create trade history")
return
}
supplyDec := decimal.NewFromBigInt(constant.TokenSupply, 0)
reserve0Dec := decimal.NewFromBigInt(swapEvent.Reserve0, 0)
reserve1Dec := decimal.NewFromBigInt(swapEvent.Reserve1, 0)
volumeDec := decimal.NewFromBigInt(swapEvent.Volume, 0)
volume24hDec := decimal.NewFromBigInt(swapEvent.Volume24H, 0)
mc := supplyDec.Mul(reserve1Dec).DivRound(reserve0Dec, 0)
err = s.d.UpdateToken(swapEvent.Token.String(), tradeHistory.Price, mc, volumeDec, volume24hDec, reserve0Dec, reserve1Dec)
if err != nil {
log.WithError(err).Error("update agent token")
return
}
log.WithFields(log.Fields{
"sender": swapEvent.Sender.Hex(),
"token": swapEvent.Token.Hex(),
"amountIn": amountIn,
"amountOut": amountOut,
"isBuy": buy,
"tx": txLog.TxHash.Hex(),
}).Info("swap success")
}
package chain
import (
"flag"
"os"
"pump/config"
"pump/contract/bonding"
"pump/contract/pair"
"pump/contract/token"
"pump/dao"
"strconv"
"time"
"github.com/ethereum/go-ethereum/common"
log "github.com/sirupsen/logrus"
)
type Sync struct {
c *config.Config
d *dao.Dao
heightKey string
bondingCa *bonding.Bonding
pairCa *pair.Pair
tokenCa *token.Token
}
var manualSync = flag.Int("sync", 0, "sync block height")
func NewSync(_c *config.Config, _d *dao.Dao) (sync *Sync) {
if *manualSync == 0 && os.Getenv("SYNC") != "" {
*manualSync, _ = strconv.Atoi(os.Getenv("SYNC"))
}
bondingCa, err := bonding.NewBonding(common.HexToAddress(_c.Chain.BondingContract), nil)
if err != nil {
panic(err)
}
pairCa, err := pair.NewPair(common.HexToAddress(_c.Chain.BondingContract), nil)
if err != nil {
panic(err)
}
tokenCa, err := token.NewToken(common.HexToAddress(_c.Chain.BondingContract), nil)
if err != nil {
panic(err)
}
sync = &Sync{
c: _c,
d: _d,
heightKey: "height",
bondingCa: bondingCa,
pairCa: pairCa,
tokenCa: tokenCa,
}
return sync
}
func (s *Sync) Start() {
lastHeight, err := s.d.GetStorageHeight(s.heightKey)
if err != nil {
log.WithError(err).Error("get last block height")
return
}
if lastHeight != 1 {
// 数据库里保存的是已完成的区块, 再次同步时+1
lastHeight++
}
if *manualSync > 0 {
lastHeight = *manualSync
}
log.WithField("height", lastHeight).Info("last sync block height")
var latestHeight int
var beginHeight = lastHeight
var endHeight = beginHeight + s.c.Chain.BatchBlock
for {
latestHeight, err = s.d.GetBlockHeight(s.c.Chain.BehindBlock)
if err != nil {
log.WithError(err).Error("get latest block height")
time.Sleep(time.Second)
continue
}
if (latestHeight-s.c.Chain.BatchBlock)-beginHeight < s.c.Chain.BatchBlock {
time.Sleep(4 * time.Second)
continue
}
s.SyncLogs(beginHeight-s.c.Chain.BatchBlock, endHeight-s.c.Chain.BatchBlock)
if err = s.d.SetStorageHeight(s.heightKey, endHeight); err != nil {
log.WithError(err).Error("set last block height")
}
log.WithFields(log.Fields{
"begin height": beginHeight,
"end height": endHeight,
"latest height": latestHeight,
"diff height": latestHeight - endHeight,
}).Info("sync block")
beginHeight = endHeight + 1
endHeight = beginHeight + s.c.Chain.BatchBlock
}
}
func (s *Sync) SyncLogs(beginHeight, endHeight int) {
if endHeight < 0 {
return
}
if beginHeight < 0 {
beginHeight = 0
}
abi, _ := bonding.BondingMetaData.GetAbi()
topics := []string{
abi.Events["Launched"].ID.Hex(),
abi.Events["Graduated"].ID.Hex(),
abi.Events["Swap"].ID.Hex(),
}
logs, err := s.d.GetLogs(beginHeight, endHeight, topics, []string{s.c.Chain.BondingContract})
if err != nil {
log.WithFields(log.Fields{"begin": beginHeight, "end": endHeight}).WithError(err).Error("rpc: get logs")
return
}
for _, txLog := range logs {
// s.Filterpump(txLog)
s.FilterLaunch(txLog)
s.FilterGraduate(txLog)
s.FilterSwap(txLog)
}
}
package main
import (
"flag"
"pump/chain"
"pump/config"
"pump/dao"
log "github.com/sirupsen/logrus"
)
func init() {
log.SetFormatter(&log.TextFormatter{
FullTimestamp: true,
})
}
func main() {
flag.Parse()
conf, err := config.New()
if err != nil {
panic(err)
}
d, err := dao.New(conf)
if err != nil {
panic(err)
}
if conf.Debug {
log.SetLevel(log.DebugLevel)
}
syncer := chain.NewSync(conf, d)
go syncer.Start()
select {}
}
debug = true
[chain]
rpc = 'https://sepolia.base.org'
batch_block = 4
behind_block = 0
bonding_contract = "0xa6dB4C4cC9fa53c749e4339D81b4b003EfF74500"
[pgsql]
host = 'aws-0-ap-northeast-1.pooler.supabase.com'
port = 5432
user = 'postgres.xjlxljoqbenbvslttrfu'
password = 'bitcointest3'
database = 'postgres'
max_conn = 5
max_idle_conn = 2
package config
import (
"flag"
"github.com/BurntSushi/toml"
)
type Config struct {
Debug bool `toml:"debug"`
PGSQL PGSQLConfig `toml:"pgsql"`
Chain ChainConfig `toml:"chain"`
}
type ChainConfig struct {
RPC string `toml:"rpc"`
ChainId int `toml:"chain_id"`
BondingContract string `toml:"bonding_contract"`
BatchBlock int `toml:"batch_block"`
BehindBlock int `toml:"behind_block"`
}
type PGSQLConfig struct {
Host string `toml:"host"`
Port int `toml:"port"`
User string `toml:"user"`
Password string `toml:"password"`
Database string `toml:"database"`
MaxConn int `toml:"max_conn"`
MaxIdleConn int `toml:"max_idle_conn"`
EnableLog bool `toml:"enable_log"`
CertFile string `toml:"cert_file"`
}
var confPath = flag.String("c", "config.toml", "config file path")
func New() (config *Config, err error) {
config = new(Config)
_, err = toml.DecodeFile(*confPath, config)
if err != nil {
return nil, err
}
return
}
package constant
import (
"math/big"
)
const JwtSecret = "uEj7AgDNCREwsvnTaCEtzDXt0I5eFDl8"
const (
InvalidParam = "invalid param"
UnsupportedPlatform = "unsupported platform"
InternalError = "internal error"
)
var TokenSupply, _ = new(big.Int).SetString("1000000000000000000000000000", 10)
var AssetSupply, _ = new(big.Int).SetString("1000000000000000000", 10) // 1 ether
[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "InvalidInitialization",
"type": "error"
},
{
"inputs": [],
"name": "NotInitializing",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "OwnableInvalidOwner",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "OwnableUnauthorizedAccount",
"type": "error"
},
{
"inputs": [],
"name": "ReentrancyGuardReentrantCall",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "SafeERC20FailedOperation",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "univ2Pair",
"type": "address"
}
],
"name": "Graduated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint64",
"name": "version",
"type": "uint64"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "pair",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "Launched",
"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": "sender",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount0In",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount0Out",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount1In",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount1Out",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "reserve0",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "reserve1",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "volume",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "volume24H",
"type": "uint256"
}
],
"name": "Swap",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "addedPool",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "idx",
"type": "uint256"
}
],
"name": "UniswapPoolCreated",
"type": "event"
},
{
"inputs": [],
"name": "K",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "assetRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountIn",
"type": "uint256"
},
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
}
],
"name": "buy",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "factory",
"outputs": [
{
"internalType": "contract FFactory",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "fee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getUniswapPairsLength",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "getUserTokens",
"outputs": [
{
"internalType": "address[]",
"name": "",
"type": "address[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gradThreshold",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "initialSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "factory_",
"type": "address"
},
{
"internalType": "address",
"name": "router_",
"type": "address"
},
{
"internalType": "address",
"name": "feeTo_",
"type": "address"
},
{
"internalType": "uint256",
"name": "fee_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "initialSupply_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "assetRate_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxTx_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "gradThreshold_",
"type": "uint256"
},
{
"internalType": "address",
"name": "uniswapV2Router_",
"type": "address"
},
{
"internalType": "address",
"name": "lpLocker_",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_ticker",
"type": "string"
},
{
"internalType": "string",
"name": "desc",
"type": "string"
},
{
"internalType": "string",
"name": "img",
"type": "string"
},
{
"internalType": "string[3]",
"name": "urls",
"type": "string[3]"
},
{
"internalType": "uint256",
"name": "purchaseAmount",
"type": "uint256"
},
{
"internalType": "address",
"name": "nftAddress",
"type": "address"
}
],
"name": "launch",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "lpLocker",
"outputs": [
{
"internalType": "contract LPLocker",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxTx",
"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": "",
"type": "address"
}
],
"name": "profile",
"outputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "profiles",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "router",
"outputs": [
{
"internalType": "contract FRouter",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amountIn",
"type": "uint256"
},
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
}
],
"name": "sell",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "newRate",
"type": "uint256"
}
],
"name": "setAssetRate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "newFee",
"type": "uint256"
},
{
"internalType": "address",
"name": "newFeeTo",
"type": "address"
}
],
"name": "setFee",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "newThreshold",
"type": "uint256"
}
],
"name": "setGradThreshold",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "newSupply",
"type": "uint256"
}
],
"name": "setInitialSupply",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "maxTx_",
"type": "uint256"
}
],
"name": "setMaxTx",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newRouter",
"type": "address"
}
],
"name": "setUniswapRouter",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "tokenInfo",
"outputs": [
{
"internalType": "address",
"name": "creator",
"type": "address"
},
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "pair",
"type": "address"
},
{
"internalType": "address",
"name": "nftAddress",
"type": "address"
},
{
"components": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "string",
"name": "name",
"type": "string"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "ticker",
"type": "string"
},
{
"internalType": "uint256",
"name": "supply",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "price",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "marketCap",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "volume",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "volume24H",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "prevPrice",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "lastUpdated",
"type": "uint256"
}
],
"internalType": "struct Bonding.Data",
"name": "data",
"type": "tuple"
},
{
"internalType": "string",
"name": "description",
"type": "string"
},
{
"internalType": "string",
"name": "image",
"type": "string"
},
{
"internalType": "string",
"name": "website",
"type": "string"
},
{
"internalType": "string",
"name": "twitter",
"type": "string"
},
{
"internalType": "string",
"name": "telegram",
"type": "string"
},
{
"internalType": "bool",
"name": "trading",
"type": "bool"
},
{
"internalType": "bool",
"name": "tradingOnUniswap",
"type": "bool"
},
{
"internalType": "address",
"name": "uniswapV2Pair",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "tokenInfos",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "uniswapPairs",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "uniswapRouter",
"outputs": [
{
"internalType": "contract IUniswapV2Router02",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
]
\ No newline at end of file
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package bonding
import (
"errors"
"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 (
_ = errors.New
_ = big.NewInt
_ = strings.NewReader
_ = ethereum.NotFound
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = event.NewSubscription
_ = abi.ConvertType
)
// BondingData is an auto generated low-level Go binding around an user-defined struct.
type BondingData struct {
Token common.Address
Name string
Name0 string
Ticker string
Supply *big.Int
Price *big.Int
MarketCap *big.Int
Liquidity *big.Int
Volume *big.Int
Volume24H *big.Int
PrevPrice *big.Int
LastUpdated *big.Int
}
// BondingMetaData contains all meta data concerning the Bonding contract.
var BondingMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrancyGuardReentrantCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"univ2Pair\",\"type\":\"address\"}],\"name\":\"Graduated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pair\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"Launched\",\"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\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reserve0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reserve1\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"volume\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"volume24H\",\"type\":\"uint256\"}],\"name\":\"Swap\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"addedPool\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"idx\",\"type\":\"uint256\"}],\"name\":\"UniswapPoolCreated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"K\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"assetRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"buy\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"contractFFactory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUniswapPairsLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getUserTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gradThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"factory_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"router_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"feeTo_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"fee_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initialSupply_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"assetRate_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTx_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gradThreshold_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"uniswapV2Router_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"lpLocker_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_ticker\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"desc\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"img\",\"type\":\"string\"},{\"internalType\":\"string[3]\",\"name\":\"urls\",\"type\":\"string[3]\"},{\"internalType\":\"uint256\",\"name\":\"purchaseAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"nftAddress\",\"type\":\"address\"}],\"name\":\"launch\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lpLocker\",\"outputs\":[{\"internalType\":\"contractLPLocker\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxTx\",\"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\":\"\",\"type\":\"address\"}],\"name\":\"profile\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"profiles\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"router\",\"outputs\":[{\"internalType\":\"contractFRouter\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"sell\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newRate\",\"type\":\"uint256\"}],\"name\":\"setAssetRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newFee\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newFeeTo\",\"type\":\"address\"}],\"name\":\"setFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newThreshold\",\"type\":\"uint256\"}],\"name\":\"setGradThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newSupply\",\"type\":\"uint256\"}],\"name\":\"setInitialSupply\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxTx_\",\"type\":\"uint256\"}],\"name\":\"setMaxTx\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRouter\",\"type\":\"address\"}],\"name\":\"setUniswapRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pair\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nftAddress\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"ticker\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"supply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"marketCap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"volume\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"volume24H\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prevPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastUpdated\",\"type\":\"uint256\"}],\"internalType\":\"structBonding.Data\",\"name\":\"data\",\"type\":\"tuple\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"image\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"website\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"twitter\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"telegram\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"trading\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"tradingOnUniswap\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"uniswapV2Pair\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"tokenInfos\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uniswapPairs\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapRouter\",\"outputs\":[{\"internalType\":\"contractIUniswapV2Router02\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
}
// BondingABI is the input ABI used to generate the binding from.
// Deprecated: Use BondingMetaData.ABI instead.
var BondingABI = BondingMetaData.ABI
// Bonding is an auto generated Go binding around an Ethereum contract.
type Bonding struct {
BondingCaller // Read-only binding to the contract
BondingTransactor // Write-only binding to the contract
BondingFilterer // Log filterer for contract events
}
// BondingCaller is an auto generated read-only Go binding around an Ethereum contract.
type BondingCaller struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// BondingTransactor is an auto generated write-only Go binding around an Ethereum contract.
type BondingTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// BondingFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
type BondingFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// BondingSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type BondingSession struct {
Contract *Bonding // 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
}
// BondingCallerSession is an auto generated read-only Go binding around an Ethereum contract,
// with pre-set call options.
type BondingCallerSession struct {
Contract *BondingCaller // Generic contract caller binding to set the session for
CallOpts bind.CallOpts // Call options to use throughout this session
}
// BondingTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
// with pre-set transact options.
type BondingTransactorSession struct {
Contract *BondingTransactor // Generic contract transactor binding to set the session for
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
// BondingRaw is an auto generated low-level Go binding around an Ethereum contract.
type BondingRaw struct {
Contract *Bonding // Generic contract binding to access the raw methods on
}
// BondingCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
type BondingCallerRaw struct {
Contract *BondingCaller // Generic read-only contract binding to access the raw methods on
}
// BondingTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
type BondingTransactorRaw struct {
Contract *BondingTransactor // Generic write-only contract binding to access the raw methods on
}
// NewBonding creates a new instance of Bonding, bound to a specific deployed contract.
func NewBonding(address common.Address, backend bind.ContractBackend) (*Bonding, error) {
contract, err := bindBonding(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &Bonding{BondingCaller: BondingCaller{contract: contract}, BondingTransactor: BondingTransactor{contract: contract}, BondingFilterer: BondingFilterer{contract: contract}}, nil
}
// NewBondingCaller creates a new read-only instance of Bonding, bound to a specific deployed contract.
func NewBondingCaller(address common.Address, caller bind.ContractCaller) (*BondingCaller, error) {
contract, err := bindBonding(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &BondingCaller{contract: contract}, nil
}
// NewBondingTransactor creates a new write-only instance of Bonding, bound to a specific deployed contract.
func NewBondingTransactor(address common.Address, transactor bind.ContractTransactor) (*BondingTransactor, error) {
contract, err := bindBonding(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &BondingTransactor{contract: contract}, nil
}
// NewBondingFilterer creates a new log filterer instance of Bonding, bound to a specific deployed contract.
func NewBondingFilterer(address common.Address, filterer bind.ContractFilterer) (*BondingFilterer, error) {
contract, err := bindBonding(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &BondingFilterer{contract: contract}, nil
}
// bindBonding binds a generic wrapper to an already deployed contract.
func bindBonding(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := BondingMetaData.GetAbi()
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 (_Bonding *BondingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Bonding.Contract.BondingCaller.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 (_Bonding *BondingRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _Bonding.Contract.BondingTransactor.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_Bonding *BondingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _Bonding.Contract.BondingTransactor.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 (_Bonding *BondingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Bonding.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 (_Bonding *BondingTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _Bonding.Contract.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_Bonding *BondingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _Bonding.Contract.contract.Transact(opts, method, params...)
}
// K is a free data retrieval call binding the contract method 0xa932492f.
//
// Solidity: function K() view returns(uint256)
func (_Bonding *BondingCaller) K(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "K")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// K is a free data retrieval call binding the contract method 0xa932492f.
//
// Solidity: function K() view returns(uint256)
func (_Bonding *BondingSession) K() (*big.Int, error) {
return _Bonding.Contract.K(&_Bonding.CallOpts)
}
// K is a free data retrieval call binding the contract method 0xa932492f.
//
// Solidity: function K() view returns(uint256)
func (_Bonding *BondingCallerSession) K() (*big.Int, error) {
return _Bonding.Contract.K(&_Bonding.CallOpts)
}
// AssetRate is a free data retrieval call binding the contract method 0xe8e6ed69.
//
// Solidity: function assetRate() view returns(uint256)
func (_Bonding *BondingCaller) AssetRate(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "assetRate")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// AssetRate is a free data retrieval call binding the contract method 0xe8e6ed69.
//
// Solidity: function assetRate() view returns(uint256)
func (_Bonding *BondingSession) AssetRate() (*big.Int, error) {
return _Bonding.Contract.AssetRate(&_Bonding.CallOpts)
}
// AssetRate is a free data retrieval call binding the contract method 0xe8e6ed69.
//
// Solidity: function assetRate() view returns(uint256)
func (_Bonding *BondingCallerSession) AssetRate() (*big.Int, error) {
return _Bonding.Contract.AssetRate(&_Bonding.CallOpts)
}
// Factory is a free data retrieval call binding the contract method 0xc45a0155.
//
// Solidity: function factory() view returns(address)
func (_Bonding *BondingCaller) Factory(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "factory")
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// Factory is a free data retrieval call binding the contract method 0xc45a0155.
//
// Solidity: function factory() view returns(address)
func (_Bonding *BondingSession) Factory() (common.Address, error) {
return _Bonding.Contract.Factory(&_Bonding.CallOpts)
}
// Factory is a free data retrieval call binding the contract method 0xc45a0155.
//
// Solidity: function factory() view returns(address)
func (_Bonding *BondingCallerSession) Factory() (common.Address, error) {
return _Bonding.Contract.Factory(&_Bonding.CallOpts)
}
// Fee is a free data retrieval call binding the contract method 0xddca3f43.
//
// Solidity: function fee() view returns(uint256)
func (_Bonding *BondingCaller) Fee(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "fee")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// Fee is a free data retrieval call binding the contract method 0xddca3f43.
//
// Solidity: function fee() view returns(uint256)
func (_Bonding *BondingSession) Fee() (*big.Int, error) {
return _Bonding.Contract.Fee(&_Bonding.CallOpts)
}
// Fee is a free data retrieval call binding the contract method 0xddca3f43.
//
// Solidity: function fee() view returns(uint256)
func (_Bonding *BondingCallerSession) Fee() (*big.Int, error) {
return _Bonding.Contract.Fee(&_Bonding.CallOpts)
}
// GetUniswapPairsLength is a free data retrieval call binding the contract method 0xbbfefbd5.
//
// Solidity: function getUniswapPairsLength() view returns(uint256)
func (_Bonding *BondingCaller) GetUniswapPairsLength(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "getUniswapPairsLength")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// GetUniswapPairsLength is a free data retrieval call binding the contract method 0xbbfefbd5.
//
// Solidity: function getUniswapPairsLength() view returns(uint256)
func (_Bonding *BondingSession) GetUniswapPairsLength() (*big.Int, error) {
return _Bonding.Contract.GetUniswapPairsLength(&_Bonding.CallOpts)
}
// GetUniswapPairsLength is a free data retrieval call binding the contract method 0xbbfefbd5.
//
// Solidity: function getUniswapPairsLength() view returns(uint256)
func (_Bonding *BondingCallerSession) GetUniswapPairsLength() (*big.Int, error) {
return _Bonding.Contract.GetUniswapPairsLength(&_Bonding.CallOpts)
}
// GetUserTokens is a free data retrieval call binding the contract method 0x519dc8d2.
//
// Solidity: function getUserTokens(address account) view returns(address[])
func (_Bonding *BondingCaller) GetUserTokens(opts *bind.CallOpts, account common.Address) ([]common.Address, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "getUserTokens", account)
if err != nil {
return *new([]common.Address), err
}
out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address)
return out0, err
}
// GetUserTokens is a free data retrieval call binding the contract method 0x519dc8d2.
//
// Solidity: function getUserTokens(address account) view returns(address[])
func (_Bonding *BondingSession) GetUserTokens(account common.Address) ([]common.Address, error) {
return _Bonding.Contract.GetUserTokens(&_Bonding.CallOpts, account)
}
// GetUserTokens is a free data retrieval call binding the contract method 0x519dc8d2.
//
// Solidity: function getUserTokens(address account) view returns(address[])
func (_Bonding *BondingCallerSession) GetUserTokens(account common.Address) ([]common.Address, error) {
return _Bonding.Contract.GetUserTokens(&_Bonding.CallOpts, account)
}
// GradThreshold is a free data retrieval call binding the contract method 0x6edd12e0.
//
// Solidity: function gradThreshold() view returns(uint256)
func (_Bonding *BondingCaller) GradThreshold(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "gradThreshold")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// GradThreshold is a free data retrieval call binding the contract method 0x6edd12e0.
//
// Solidity: function gradThreshold() view returns(uint256)
func (_Bonding *BondingSession) GradThreshold() (*big.Int, error) {
return _Bonding.Contract.GradThreshold(&_Bonding.CallOpts)
}
// GradThreshold is a free data retrieval call binding the contract method 0x6edd12e0.
//
// Solidity: function gradThreshold() view returns(uint256)
func (_Bonding *BondingCallerSession) GradThreshold() (*big.Int, error) {
return _Bonding.Contract.GradThreshold(&_Bonding.CallOpts)
}
// InitialSupply is a free data retrieval call binding the contract method 0x378dc3dc.
//
// Solidity: function initialSupply() view returns(uint256)
func (_Bonding *BondingCaller) InitialSupply(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "initialSupply")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// InitialSupply is a free data retrieval call binding the contract method 0x378dc3dc.
//
// Solidity: function initialSupply() view returns(uint256)
func (_Bonding *BondingSession) InitialSupply() (*big.Int, error) {
return _Bonding.Contract.InitialSupply(&_Bonding.CallOpts)
}
// InitialSupply is a free data retrieval call binding the contract method 0x378dc3dc.
//
// Solidity: function initialSupply() view returns(uint256)
func (_Bonding *BondingCallerSession) InitialSupply() (*big.Int, error) {
return _Bonding.Contract.InitialSupply(&_Bonding.CallOpts)
}
// LpLocker is a free data retrieval call binding the contract method 0x03fc2013.
//
// Solidity: function lpLocker() view returns(address)
func (_Bonding *BondingCaller) LpLocker(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "lpLocker")
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// LpLocker is a free data retrieval call binding the contract method 0x03fc2013.
//
// Solidity: function lpLocker() view returns(address)
func (_Bonding *BondingSession) LpLocker() (common.Address, error) {
return _Bonding.Contract.LpLocker(&_Bonding.CallOpts)
}
// LpLocker is a free data retrieval call binding the contract method 0x03fc2013.
//
// Solidity: function lpLocker() view returns(address)
func (_Bonding *BondingCallerSession) LpLocker() (common.Address, error) {
return _Bonding.Contract.LpLocker(&_Bonding.CallOpts)
}
// MaxTx is a free data retrieval call binding the contract method 0x7437681e.
//
// Solidity: function maxTx() view returns(uint256)
func (_Bonding *BondingCaller) MaxTx(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "maxTx")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// MaxTx is a free data retrieval call binding the contract method 0x7437681e.
//
// Solidity: function maxTx() view returns(uint256)
func (_Bonding *BondingSession) MaxTx() (*big.Int, error) {
return _Bonding.Contract.MaxTx(&_Bonding.CallOpts)
}
// MaxTx is a free data retrieval call binding the contract method 0x7437681e.
//
// Solidity: function maxTx() view returns(uint256)
func (_Bonding *BondingCallerSession) MaxTx() (*big.Int, error) {
return _Bonding.Contract.MaxTx(&_Bonding.CallOpts)
}
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
//
// Solidity: function owner() view returns(address)
func (_Bonding *BondingCaller) Owner(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _Bonding.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 (_Bonding *BondingSession) Owner() (common.Address, error) {
return _Bonding.Contract.Owner(&_Bonding.CallOpts)
}
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
//
// Solidity: function owner() view returns(address)
func (_Bonding *BondingCallerSession) Owner() (common.Address, error) {
return _Bonding.Contract.Owner(&_Bonding.CallOpts)
}
// Profile is a free data retrieval call binding the contract method 0x9dd9d0fd.
//
// Solidity: function profile(address ) view returns(address user)
func (_Bonding *BondingCaller) Profile(opts *bind.CallOpts, arg0 common.Address) (common.Address, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "profile", arg0)
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// Profile is a free data retrieval call binding the contract method 0x9dd9d0fd.
//
// Solidity: function profile(address ) view returns(address user)
func (_Bonding *BondingSession) Profile(arg0 common.Address) (common.Address, error) {
return _Bonding.Contract.Profile(&_Bonding.CallOpts, arg0)
}
// Profile is a free data retrieval call binding the contract method 0x9dd9d0fd.
//
// Solidity: function profile(address ) view returns(address user)
func (_Bonding *BondingCallerSession) Profile(arg0 common.Address) (common.Address, error) {
return _Bonding.Contract.Profile(&_Bonding.CallOpts, arg0)
}
// Profiles is a free data retrieval call binding the contract method 0xc36fe3d6.
//
// Solidity: function profiles(uint256 ) view returns(address)
func (_Bonding *BondingCaller) Profiles(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "profiles", arg0)
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// Profiles is a free data retrieval call binding the contract method 0xc36fe3d6.
//
// Solidity: function profiles(uint256 ) view returns(address)
func (_Bonding *BondingSession) Profiles(arg0 *big.Int) (common.Address, error) {
return _Bonding.Contract.Profiles(&_Bonding.CallOpts, arg0)
}
// Profiles is a free data retrieval call binding the contract method 0xc36fe3d6.
//
// Solidity: function profiles(uint256 ) view returns(address)
func (_Bonding *BondingCallerSession) Profiles(arg0 *big.Int) (common.Address, error) {
return _Bonding.Contract.Profiles(&_Bonding.CallOpts, arg0)
}
// Router is a free data retrieval call binding the contract method 0xf887ea40.
//
// Solidity: function router() view returns(address)
func (_Bonding *BondingCaller) Router(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "router")
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// Router is a free data retrieval call binding the contract method 0xf887ea40.
//
// Solidity: function router() view returns(address)
func (_Bonding *BondingSession) Router() (common.Address, error) {
return _Bonding.Contract.Router(&_Bonding.CallOpts)
}
// Router is a free data retrieval call binding the contract method 0xf887ea40.
//
// Solidity: function router() view returns(address)
func (_Bonding *BondingCallerSession) Router() (common.Address, error) {
return _Bonding.Contract.Router(&_Bonding.CallOpts)
}
// TokenInfo is a free data retrieval call binding the contract method 0xf5dab711.
//
// Solidity: function tokenInfo(address ) view returns(address creator, address token, address pair, address nftAddress, (address,string,string,string,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) data, string description, string image, string website, string twitter, string telegram, bool trading, bool tradingOnUniswap, address uniswapV2Pair)
func (_Bonding *BondingCaller) TokenInfo(opts *bind.CallOpts, arg0 common.Address) (struct {
Creator common.Address
Token common.Address
Pair common.Address
NftAddress common.Address
Data BondingData
Description string
Image string
Website string
Twitter string
Telegram string
Trading bool
TradingOnUniswap bool
UniswapV2Pair common.Address
}, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "tokenInfo", arg0)
outstruct := new(struct {
Creator common.Address
Token common.Address
Pair common.Address
NftAddress common.Address
Data BondingData
Description string
Image string
Website string
Twitter string
Telegram string
Trading bool
TradingOnUniswap bool
UniswapV2Pair common.Address
})
if err != nil {
return *outstruct, err
}
outstruct.Creator = *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
outstruct.Token = *abi.ConvertType(out[1], new(common.Address)).(*common.Address)
outstruct.Pair = *abi.ConvertType(out[2], new(common.Address)).(*common.Address)
outstruct.NftAddress = *abi.ConvertType(out[3], new(common.Address)).(*common.Address)
outstruct.Data = *abi.ConvertType(out[4], new(BondingData)).(*BondingData)
outstruct.Description = *abi.ConvertType(out[5], new(string)).(*string)
outstruct.Image = *abi.ConvertType(out[6], new(string)).(*string)
outstruct.Website = *abi.ConvertType(out[7], new(string)).(*string)
outstruct.Twitter = *abi.ConvertType(out[8], new(string)).(*string)
outstruct.Telegram = *abi.ConvertType(out[9], new(string)).(*string)
outstruct.Trading = *abi.ConvertType(out[10], new(bool)).(*bool)
outstruct.TradingOnUniswap = *abi.ConvertType(out[11], new(bool)).(*bool)
outstruct.UniswapV2Pair = *abi.ConvertType(out[12], new(common.Address)).(*common.Address)
return *outstruct, err
}
// TokenInfo is a free data retrieval call binding the contract method 0xf5dab711.
//
// Solidity: function tokenInfo(address ) view returns(address creator, address token, address pair, address nftAddress, (address,string,string,string,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) data, string description, string image, string website, string twitter, string telegram, bool trading, bool tradingOnUniswap, address uniswapV2Pair)
func (_Bonding *BondingSession) TokenInfo(arg0 common.Address) (struct {
Creator common.Address
Token common.Address
Pair common.Address
NftAddress common.Address
Data BondingData
Description string
Image string
Website string
Twitter string
Telegram string
Trading bool
TradingOnUniswap bool
UniswapV2Pair common.Address
}, error) {
return _Bonding.Contract.TokenInfo(&_Bonding.CallOpts, arg0)
}
// TokenInfo is a free data retrieval call binding the contract method 0xf5dab711.
//
// Solidity: function tokenInfo(address ) view returns(address creator, address token, address pair, address nftAddress, (address,string,string,string,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256) data, string description, string image, string website, string twitter, string telegram, bool trading, bool tradingOnUniswap, address uniswapV2Pair)
func (_Bonding *BondingCallerSession) TokenInfo(arg0 common.Address) (struct {
Creator common.Address
Token common.Address
Pair common.Address
NftAddress common.Address
Data BondingData
Description string
Image string
Website string
Twitter string
Telegram string
Trading bool
TradingOnUniswap bool
UniswapV2Pair common.Address
}, error) {
return _Bonding.Contract.TokenInfo(&_Bonding.CallOpts, arg0)
}
// TokenInfos is a free data retrieval call binding the contract method 0x7c13774b.
//
// Solidity: function tokenInfos(uint256 ) view returns(address)
func (_Bonding *BondingCaller) TokenInfos(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "tokenInfos", arg0)
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// TokenInfos is a free data retrieval call binding the contract method 0x7c13774b.
//
// Solidity: function tokenInfos(uint256 ) view returns(address)
func (_Bonding *BondingSession) TokenInfos(arg0 *big.Int) (common.Address, error) {
return _Bonding.Contract.TokenInfos(&_Bonding.CallOpts, arg0)
}
// TokenInfos is a free data retrieval call binding the contract method 0x7c13774b.
//
// Solidity: function tokenInfos(uint256 ) view returns(address)
func (_Bonding *BondingCallerSession) TokenInfos(arg0 *big.Int) (common.Address, error) {
return _Bonding.Contract.TokenInfos(&_Bonding.CallOpts, arg0)
}
// UniswapPairs is a free data retrieval call binding the contract method 0x8397e993.
//
// Solidity: function uniswapPairs(uint256 ) view returns(address)
func (_Bonding *BondingCaller) UniswapPairs(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "uniswapPairs", arg0)
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// UniswapPairs is a free data retrieval call binding the contract method 0x8397e993.
//
// Solidity: function uniswapPairs(uint256 ) view returns(address)
func (_Bonding *BondingSession) UniswapPairs(arg0 *big.Int) (common.Address, error) {
return _Bonding.Contract.UniswapPairs(&_Bonding.CallOpts, arg0)
}
// UniswapPairs is a free data retrieval call binding the contract method 0x8397e993.
//
// Solidity: function uniswapPairs(uint256 ) view returns(address)
func (_Bonding *BondingCallerSession) UniswapPairs(arg0 *big.Int) (common.Address, error) {
return _Bonding.Contract.UniswapPairs(&_Bonding.CallOpts, arg0)
}
// UniswapRouter is a free data retrieval call binding the contract method 0x735de9f7.
//
// Solidity: function uniswapRouter() view returns(address)
func (_Bonding *BondingCaller) UniswapRouter(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _Bonding.contract.Call(opts, &out, "uniswapRouter")
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// UniswapRouter is a free data retrieval call binding the contract method 0x735de9f7.
//
// Solidity: function uniswapRouter() view returns(address)
func (_Bonding *BondingSession) UniswapRouter() (common.Address, error) {
return _Bonding.Contract.UniswapRouter(&_Bonding.CallOpts)
}
// UniswapRouter is a free data retrieval call binding the contract method 0x735de9f7.
//
// Solidity: function uniswapRouter() view returns(address)
func (_Bonding *BondingCallerSession) UniswapRouter() (common.Address, error) {
return _Bonding.Contract.UniswapRouter(&_Bonding.CallOpts)
}
// Buy is a paid mutator transaction binding the contract method 0x7deb6025.
//
// Solidity: function buy(uint256 amountIn, address tokenAddress) payable returns(bool)
func (_Bonding *BondingTransactor) Buy(opts *bind.TransactOpts, amountIn *big.Int, tokenAddress common.Address) (*types.Transaction, error) {
return _Bonding.contract.Transact(opts, "buy", amountIn, tokenAddress)
}
// Buy is a paid mutator transaction binding the contract method 0x7deb6025.
//
// Solidity: function buy(uint256 amountIn, address tokenAddress) payable returns(bool)
func (_Bonding *BondingSession) Buy(amountIn *big.Int, tokenAddress common.Address) (*types.Transaction, error) {
return _Bonding.Contract.Buy(&_Bonding.TransactOpts, amountIn, tokenAddress)
}
// Buy is a paid mutator transaction binding the contract method 0x7deb6025.
//
// Solidity: function buy(uint256 amountIn, address tokenAddress) payable returns(bool)
func (_Bonding *BondingTransactorSession) Buy(amountIn *big.Int, tokenAddress common.Address) (*types.Transaction, error) {
return _Bonding.Contract.Buy(&_Bonding.TransactOpts, amountIn, tokenAddress)
}
// Initialize is a paid mutator transaction binding the contract method 0x85eea923.
//
// Solidity: function initialize(address factory_, address router_, address feeTo_, uint256 fee_, uint256 initialSupply_, uint256 assetRate_, uint256 maxTx_, uint256 gradThreshold_, address uniswapV2Router_, address lpLocker_) returns()
func (_Bonding *BondingTransactor) Initialize(opts *bind.TransactOpts, factory_ common.Address, router_ common.Address, feeTo_ common.Address, fee_ *big.Int, initialSupply_ *big.Int, assetRate_ *big.Int, maxTx_ *big.Int, gradThreshold_ *big.Int, uniswapV2Router_ common.Address, lpLocker_ common.Address) (*types.Transaction, error) {
return _Bonding.contract.Transact(opts, "initialize", factory_, router_, feeTo_, fee_, initialSupply_, assetRate_, maxTx_, gradThreshold_, uniswapV2Router_, lpLocker_)
}
// Initialize is a paid mutator transaction binding the contract method 0x85eea923.
//
// Solidity: function initialize(address factory_, address router_, address feeTo_, uint256 fee_, uint256 initialSupply_, uint256 assetRate_, uint256 maxTx_, uint256 gradThreshold_, address uniswapV2Router_, address lpLocker_) returns()
func (_Bonding *BondingSession) Initialize(factory_ common.Address, router_ common.Address, feeTo_ common.Address, fee_ *big.Int, initialSupply_ *big.Int, assetRate_ *big.Int, maxTx_ *big.Int, gradThreshold_ *big.Int, uniswapV2Router_ common.Address, lpLocker_ common.Address) (*types.Transaction, error) {
return _Bonding.Contract.Initialize(&_Bonding.TransactOpts, factory_, router_, feeTo_, fee_, initialSupply_, assetRate_, maxTx_, gradThreshold_, uniswapV2Router_, lpLocker_)
}
// Initialize is a paid mutator transaction binding the contract method 0x85eea923.
//
// Solidity: function initialize(address factory_, address router_, address feeTo_, uint256 fee_, uint256 initialSupply_, uint256 assetRate_, uint256 maxTx_, uint256 gradThreshold_, address uniswapV2Router_, address lpLocker_) returns()
func (_Bonding *BondingTransactorSession) Initialize(factory_ common.Address, router_ common.Address, feeTo_ common.Address, fee_ *big.Int, initialSupply_ *big.Int, assetRate_ *big.Int, maxTx_ *big.Int, gradThreshold_ *big.Int, uniswapV2Router_ common.Address, lpLocker_ common.Address) (*types.Transaction, error) {
return _Bonding.Contract.Initialize(&_Bonding.TransactOpts, factory_, router_, feeTo_, fee_, initialSupply_, assetRate_, maxTx_, gradThreshold_, uniswapV2Router_, lpLocker_)
}
// Launch is a paid mutator transaction binding the contract method 0x3f1250f7.
//
// Solidity: function launch(string _name, string _ticker, string desc, string img, string[3] urls, uint256 purchaseAmount, address nftAddress) payable returns(address, address, uint256)
func (_Bonding *BondingTransactor) Launch(opts *bind.TransactOpts, _name string, _ticker string, desc string, img string, urls [3]string, purchaseAmount *big.Int, nftAddress common.Address) (*types.Transaction, error) {
return _Bonding.contract.Transact(opts, "launch", _name, _ticker, desc, img, urls, purchaseAmount, nftAddress)
}
// Launch is a paid mutator transaction binding the contract method 0x3f1250f7.
//
// Solidity: function launch(string _name, string _ticker, string desc, string img, string[3] urls, uint256 purchaseAmount, address nftAddress) payable returns(address, address, uint256)
func (_Bonding *BondingSession) Launch(_name string, _ticker string, desc string, img string, urls [3]string, purchaseAmount *big.Int, nftAddress common.Address) (*types.Transaction, error) {
return _Bonding.Contract.Launch(&_Bonding.TransactOpts, _name, _ticker, desc, img, urls, purchaseAmount, nftAddress)
}
// Launch is a paid mutator transaction binding the contract method 0x3f1250f7.
//
// Solidity: function launch(string _name, string _ticker, string desc, string img, string[3] urls, uint256 purchaseAmount, address nftAddress) payable returns(address, address, uint256)
func (_Bonding *BondingTransactorSession) Launch(_name string, _ticker string, desc string, img string, urls [3]string, purchaseAmount *big.Int, nftAddress common.Address) (*types.Transaction, error) {
return _Bonding.Contract.Launch(&_Bonding.TransactOpts, _name, _ticker, desc, img, urls, purchaseAmount, nftAddress)
}
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_Bonding *BondingTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) {
return _Bonding.contract.Transact(opts, "renounceOwnership")
}
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_Bonding *BondingSession) RenounceOwnership() (*types.Transaction, error) {
return _Bonding.Contract.RenounceOwnership(&_Bonding.TransactOpts)
}
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_Bonding *BondingTransactorSession) RenounceOwnership() (*types.Transaction, error) {
return _Bonding.Contract.RenounceOwnership(&_Bonding.TransactOpts)
}
// Sell is a paid mutator transaction binding the contract method 0x4189a68e.
//
// Solidity: function sell(uint256 amountIn, address tokenAddress) returns(bool)
func (_Bonding *BondingTransactor) Sell(opts *bind.TransactOpts, amountIn *big.Int, tokenAddress common.Address) (*types.Transaction, error) {
return _Bonding.contract.Transact(opts, "sell", amountIn, tokenAddress)
}
// Sell is a paid mutator transaction binding the contract method 0x4189a68e.
//
// Solidity: function sell(uint256 amountIn, address tokenAddress) returns(bool)
func (_Bonding *BondingSession) Sell(amountIn *big.Int, tokenAddress common.Address) (*types.Transaction, error) {
return _Bonding.Contract.Sell(&_Bonding.TransactOpts, amountIn, tokenAddress)
}
// Sell is a paid mutator transaction binding the contract method 0x4189a68e.
//
// Solidity: function sell(uint256 amountIn, address tokenAddress) returns(bool)
func (_Bonding *BondingTransactorSession) Sell(amountIn *big.Int, tokenAddress common.Address) (*types.Transaction, error) {
return _Bonding.Contract.Sell(&_Bonding.TransactOpts, amountIn, tokenAddress)
}
// SetAssetRate is a paid mutator transaction binding the contract method 0xcc489688.
//
// Solidity: function setAssetRate(uint256 newRate) returns()
func (_Bonding *BondingTransactor) SetAssetRate(opts *bind.TransactOpts, newRate *big.Int) (*types.Transaction, error) {
return _Bonding.contract.Transact(opts, "setAssetRate", newRate)
}
// SetAssetRate is a paid mutator transaction binding the contract method 0xcc489688.
//
// Solidity: function setAssetRate(uint256 newRate) returns()
func (_Bonding *BondingSession) SetAssetRate(newRate *big.Int) (*types.Transaction, error) {
return _Bonding.Contract.SetAssetRate(&_Bonding.TransactOpts, newRate)
}
// SetAssetRate is a paid mutator transaction binding the contract method 0xcc489688.
//
// Solidity: function setAssetRate(uint256 newRate) returns()
func (_Bonding *BondingTransactorSession) SetAssetRate(newRate *big.Int) (*types.Transaction, error) {
return _Bonding.Contract.SetAssetRate(&_Bonding.TransactOpts, newRate)
}
// SetFee is a paid mutator transaction binding the contract method 0xb4f2e8b8.
//
// Solidity: function setFee(uint256 newFee, address newFeeTo) returns()
func (_Bonding *BondingTransactor) SetFee(opts *bind.TransactOpts, newFee *big.Int, newFeeTo common.Address) (*types.Transaction, error) {
return _Bonding.contract.Transact(opts, "setFee", newFee, newFeeTo)
}
// SetFee is a paid mutator transaction binding the contract method 0xb4f2e8b8.
//
// Solidity: function setFee(uint256 newFee, address newFeeTo) returns()
func (_Bonding *BondingSession) SetFee(newFee *big.Int, newFeeTo common.Address) (*types.Transaction, error) {
return _Bonding.Contract.SetFee(&_Bonding.TransactOpts, newFee, newFeeTo)
}
// SetFee is a paid mutator transaction binding the contract method 0xb4f2e8b8.
//
// Solidity: function setFee(uint256 newFee, address newFeeTo) returns()
func (_Bonding *BondingTransactorSession) SetFee(newFee *big.Int, newFeeTo common.Address) (*types.Transaction, error) {
return _Bonding.Contract.SetFee(&_Bonding.TransactOpts, newFee, newFeeTo)
}
// SetGradThreshold is a paid mutator transaction binding the contract method 0x09c8962c.
//
// Solidity: function setGradThreshold(uint256 newThreshold) returns()
func (_Bonding *BondingTransactor) SetGradThreshold(opts *bind.TransactOpts, newThreshold *big.Int) (*types.Transaction, error) {
return _Bonding.contract.Transact(opts, "setGradThreshold", newThreshold)
}
// SetGradThreshold is a paid mutator transaction binding the contract method 0x09c8962c.
//
// Solidity: function setGradThreshold(uint256 newThreshold) returns()
func (_Bonding *BondingSession) SetGradThreshold(newThreshold *big.Int) (*types.Transaction, error) {
return _Bonding.Contract.SetGradThreshold(&_Bonding.TransactOpts, newThreshold)
}
// SetGradThreshold is a paid mutator transaction binding the contract method 0x09c8962c.
//
// Solidity: function setGradThreshold(uint256 newThreshold) returns()
func (_Bonding *BondingTransactorSession) SetGradThreshold(newThreshold *big.Int) (*types.Transaction, error) {
return _Bonding.Contract.SetGradThreshold(&_Bonding.TransactOpts, newThreshold)
}
// SetInitialSupply is a paid mutator transaction binding the contract method 0x61402596.
//
// Solidity: function setInitialSupply(uint256 newSupply) returns()
func (_Bonding *BondingTransactor) SetInitialSupply(opts *bind.TransactOpts, newSupply *big.Int) (*types.Transaction, error) {
return _Bonding.contract.Transact(opts, "setInitialSupply", newSupply)
}
// SetInitialSupply is a paid mutator transaction binding the contract method 0x61402596.
//
// Solidity: function setInitialSupply(uint256 newSupply) returns()
func (_Bonding *BondingSession) SetInitialSupply(newSupply *big.Int) (*types.Transaction, error) {
return _Bonding.Contract.SetInitialSupply(&_Bonding.TransactOpts, newSupply)
}
// SetInitialSupply is a paid mutator transaction binding the contract method 0x61402596.
//
// Solidity: function setInitialSupply(uint256 newSupply) returns()
func (_Bonding *BondingTransactorSession) SetInitialSupply(newSupply *big.Int) (*types.Transaction, error) {
return _Bonding.Contract.SetInitialSupply(&_Bonding.TransactOpts, newSupply)
}
// SetMaxTx is a paid mutator transaction binding the contract method 0xbc337182.
//
// Solidity: function setMaxTx(uint256 maxTx_) returns()
func (_Bonding *BondingTransactor) SetMaxTx(opts *bind.TransactOpts, maxTx_ *big.Int) (*types.Transaction, error) {
return _Bonding.contract.Transact(opts, "setMaxTx", maxTx_)
}
// SetMaxTx is a paid mutator transaction binding the contract method 0xbc337182.
//
// Solidity: function setMaxTx(uint256 maxTx_) returns()
func (_Bonding *BondingSession) SetMaxTx(maxTx_ *big.Int) (*types.Transaction, error) {
return _Bonding.Contract.SetMaxTx(&_Bonding.TransactOpts, maxTx_)
}
// SetMaxTx is a paid mutator transaction binding the contract method 0xbc337182.
//
// Solidity: function setMaxTx(uint256 maxTx_) returns()
func (_Bonding *BondingTransactorSession) SetMaxTx(maxTx_ *big.Int) (*types.Transaction, error) {
return _Bonding.Contract.SetMaxTx(&_Bonding.TransactOpts, maxTx_)
}
// SetUniswapRouter is a paid mutator transaction binding the contract method 0xbea9849e.
//
// Solidity: function setUniswapRouter(address newRouter) returns()
func (_Bonding *BondingTransactor) SetUniswapRouter(opts *bind.TransactOpts, newRouter common.Address) (*types.Transaction, error) {
return _Bonding.contract.Transact(opts, "setUniswapRouter", newRouter)
}
// SetUniswapRouter is a paid mutator transaction binding the contract method 0xbea9849e.
//
// Solidity: function setUniswapRouter(address newRouter) returns()
func (_Bonding *BondingSession) SetUniswapRouter(newRouter common.Address) (*types.Transaction, error) {
return _Bonding.Contract.SetUniswapRouter(&_Bonding.TransactOpts, newRouter)
}
// SetUniswapRouter is a paid mutator transaction binding the contract method 0xbea9849e.
//
// Solidity: function setUniswapRouter(address newRouter) returns()
func (_Bonding *BondingTransactorSession) SetUniswapRouter(newRouter common.Address) (*types.Transaction, error) {
return _Bonding.Contract.SetUniswapRouter(&_Bonding.TransactOpts, newRouter)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_Bonding *BondingTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {
return _Bonding.contract.Transact(opts, "transferOwnership", newOwner)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_Bonding *BondingSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
return _Bonding.Contract.TransferOwnership(&_Bonding.TransactOpts, newOwner)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_Bonding *BondingTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
return _Bonding.Contract.TransferOwnership(&_Bonding.TransactOpts, newOwner)
}
// TransferToken is a paid mutator transaction binding the contract method 0xf5537ede.
//
// Solidity: function transferToken(address token, address recipient, uint256 amount) returns()
func (_Bonding *BondingTransactor) TransferToken(opts *bind.TransactOpts, token common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) {
return _Bonding.contract.Transact(opts, "transferToken", token, recipient, amount)
}
// TransferToken is a paid mutator transaction binding the contract method 0xf5537ede.
//
// Solidity: function transferToken(address token, address recipient, uint256 amount) returns()
func (_Bonding *BondingSession) TransferToken(token common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) {
return _Bonding.Contract.TransferToken(&_Bonding.TransactOpts, token, recipient, amount)
}
// TransferToken is a paid mutator transaction binding the contract method 0xf5537ede.
//
// Solidity: function transferToken(address token, address recipient, uint256 amount) returns()
func (_Bonding *BondingTransactorSession) TransferToken(token common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) {
return _Bonding.Contract.TransferToken(&_Bonding.TransactOpts, token, recipient, amount)
}
// BondingGraduatedIterator is returned from FilterGraduated and is used to iterate over the raw logs and unpacked data for Graduated events raised by the Bonding contract.
type BondingGraduatedIterator struct {
Event *BondingGraduated // 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 *BondingGraduatedIterator) 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(BondingGraduated)
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(BondingGraduated)
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 *BondingGraduatedIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *BondingGraduatedIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// BondingGraduated represents a Graduated event raised by the Bonding contract.
type BondingGraduated struct {
Token common.Address
Univ2Pair common.Address
Raw types.Log // Blockchain specific contextual infos
}
// FilterGraduated is a free log retrieval operation binding the contract event 0x381d54fa425631e6266af114239150fae1d5db67bb65b4fa9ecc65013107e07e.
//
// Solidity: event Graduated(address indexed token, address indexed univ2Pair)
func (_Bonding *BondingFilterer) FilterGraduated(opts *bind.FilterOpts, token []common.Address, univ2Pair []common.Address) (*BondingGraduatedIterator, error) {
var tokenRule []interface{}
for _, tokenItem := range token {
tokenRule = append(tokenRule, tokenItem)
}
var univ2PairRule []interface{}
for _, univ2PairItem := range univ2Pair {
univ2PairRule = append(univ2PairRule, univ2PairItem)
}
logs, sub, err := _Bonding.contract.FilterLogs(opts, "Graduated", tokenRule, univ2PairRule)
if err != nil {
return nil, err
}
return &BondingGraduatedIterator{contract: _Bonding.contract, event: "Graduated", logs: logs, sub: sub}, nil
}
// WatchGraduated is a free log subscription operation binding the contract event 0x381d54fa425631e6266af114239150fae1d5db67bb65b4fa9ecc65013107e07e.
//
// Solidity: event Graduated(address indexed token, address indexed univ2Pair)
func (_Bonding *BondingFilterer) WatchGraduated(opts *bind.WatchOpts, sink chan<- *BondingGraduated, token []common.Address, univ2Pair []common.Address) (event.Subscription, error) {
var tokenRule []interface{}
for _, tokenItem := range token {
tokenRule = append(tokenRule, tokenItem)
}
var univ2PairRule []interface{}
for _, univ2PairItem := range univ2Pair {
univ2PairRule = append(univ2PairRule, univ2PairItem)
}
logs, sub, err := _Bonding.contract.WatchLogs(opts, "Graduated", tokenRule, univ2PairRule)
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(BondingGraduated)
if err := _Bonding.contract.UnpackLog(event, "Graduated", 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
}
// ParseGraduated is a log parse operation binding the contract event 0x381d54fa425631e6266af114239150fae1d5db67bb65b4fa9ecc65013107e07e.
//
// Solidity: event Graduated(address indexed token, address indexed univ2Pair)
func (_Bonding *BondingFilterer) ParseGraduated(log types.Log) (*BondingGraduated, error) {
event := new(BondingGraduated)
if err := _Bonding.contract.UnpackLog(event, "Graduated", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// BondingInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Bonding contract.
type BondingInitializedIterator struct {
Event *BondingInitialized // 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 *BondingInitializedIterator) 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(BondingInitialized)
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(BondingInitialized)
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 *BondingInitializedIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *BondingInitializedIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// BondingInitialized represents a Initialized event raised by the Bonding contract.
type BondingInitialized struct {
Version uint64
Raw types.Log // Blockchain specific contextual infos
}
// FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2.
//
// Solidity: event Initialized(uint64 version)
func (_Bonding *BondingFilterer) FilterInitialized(opts *bind.FilterOpts) (*BondingInitializedIterator, error) {
logs, sub, err := _Bonding.contract.FilterLogs(opts, "Initialized")
if err != nil {
return nil, err
}
return &BondingInitializedIterator{contract: _Bonding.contract, event: "Initialized", logs: logs, sub: sub}, nil
}
// WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2.
//
// Solidity: event Initialized(uint64 version)
func (_Bonding *BondingFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *BondingInitialized) (event.Subscription, error) {
logs, sub, err := _Bonding.contract.WatchLogs(opts, "Initialized")
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(BondingInitialized)
if err := _Bonding.contract.UnpackLog(event, "Initialized", 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
}
// ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2.
//
// Solidity: event Initialized(uint64 version)
func (_Bonding *BondingFilterer) ParseInitialized(log types.Log) (*BondingInitialized, error) {
event := new(BondingInitialized)
if err := _Bonding.contract.UnpackLog(event, "Initialized", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// BondingLaunchedIterator is returned from FilterLaunched and is used to iterate over the raw logs and unpacked data for Launched events raised by the Bonding contract.
type BondingLaunchedIterator struct {
Event *BondingLaunched // 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 *BondingLaunchedIterator) 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(BondingLaunched)
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(BondingLaunched)
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 *BondingLaunchedIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *BondingLaunchedIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// BondingLaunched represents a Launched event raised by the Bonding contract.
type BondingLaunched struct {
Token common.Address
Pair common.Address
Arg2 *big.Int
Raw types.Log // Blockchain specific contextual infos
}
// FilterLaunched is a free log retrieval operation binding the contract event 0x714aa39317ad9a7a7a99db52b44490da5d068a0b2710fffb1a1282ad3cadae1f.
//
// Solidity: event Launched(address indexed token, address indexed pair, uint256 arg2)
func (_Bonding *BondingFilterer) FilterLaunched(opts *bind.FilterOpts, token []common.Address, pair []common.Address) (*BondingLaunchedIterator, error) {
var tokenRule []interface{}
for _, tokenItem := range token {
tokenRule = append(tokenRule, tokenItem)
}
var pairRule []interface{}
for _, pairItem := range pair {
pairRule = append(pairRule, pairItem)
}
logs, sub, err := _Bonding.contract.FilterLogs(opts, "Launched", tokenRule, pairRule)
if err != nil {
return nil, err
}
return &BondingLaunchedIterator{contract: _Bonding.contract, event: "Launched", logs: logs, sub: sub}, nil
}
// WatchLaunched is a free log subscription operation binding the contract event 0x714aa39317ad9a7a7a99db52b44490da5d068a0b2710fffb1a1282ad3cadae1f.
//
// Solidity: event Launched(address indexed token, address indexed pair, uint256 arg2)
func (_Bonding *BondingFilterer) WatchLaunched(opts *bind.WatchOpts, sink chan<- *BondingLaunched, token []common.Address, pair []common.Address) (event.Subscription, error) {
var tokenRule []interface{}
for _, tokenItem := range token {
tokenRule = append(tokenRule, tokenItem)
}
var pairRule []interface{}
for _, pairItem := range pair {
pairRule = append(pairRule, pairItem)
}
logs, sub, err := _Bonding.contract.WatchLogs(opts, "Launched", tokenRule, pairRule)
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(BondingLaunched)
if err := _Bonding.contract.UnpackLog(event, "Launched", 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
}
// ParseLaunched is a log parse operation binding the contract event 0x714aa39317ad9a7a7a99db52b44490da5d068a0b2710fffb1a1282ad3cadae1f.
//
// Solidity: event Launched(address indexed token, address indexed pair, uint256 arg2)
func (_Bonding *BondingFilterer) ParseLaunched(log types.Log) (*BondingLaunched, error) {
event := new(BondingLaunched)
if err := _Bonding.contract.UnpackLog(event, "Launched", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// BondingOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Bonding contract.
type BondingOwnershipTransferredIterator struct {
Event *BondingOwnershipTransferred // 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 *BondingOwnershipTransferredIterator) 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(BondingOwnershipTransferred)
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(BondingOwnershipTransferred)
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 *BondingOwnershipTransferredIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *BondingOwnershipTransferredIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// BondingOwnershipTransferred represents a OwnershipTransferred event raised by the Bonding contract.
type BondingOwnershipTransferred 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 (_Bonding *BondingFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*BondingOwnershipTransferredIterator, 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 := _Bonding.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule)
if err != nil {
return nil, err
}
return &BondingOwnershipTransferredIterator{contract: _Bonding.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 (_Bonding *BondingFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BondingOwnershipTransferred, 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 := _Bonding.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(BondingOwnershipTransferred)
if err := _Bonding.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 (_Bonding *BondingFilterer) ParseOwnershipTransferred(log types.Log) (*BondingOwnershipTransferred, error) {
event := new(BondingOwnershipTransferred)
if err := _Bonding.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// BondingSwapIterator is returned from FilterSwap and is used to iterate over the raw logs and unpacked data for Swap events raised by the Bonding contract.
type BondingSwapIterator struct {
Event *BondingSwap // 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 *BondingSwapIterator) 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(BondingSwap)
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(BondingSwap)
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 *BondingSwapIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *BondingSwapIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// BondingSwap represents a Swap event raised by the Bonding contract.
type BondingSwap struct {
Sender common.Address
Token common.Address
Amount0In *big.Int
Amount0Out *big.Int
Amount1In *big.Int
Amount1Out *big.Int
Reserve0 *big.Int
Reserve1 *big.Int
Volume *big.Int
Volume24H *big.Int
Raw types.Log // Blockchain specific contextual infos
}
// FilterSwap is a free log retrieval operation binding the contract event 0x3fe84e6df58344329a18c304c0110e2a518d8c1dfce228cd1f78d11c59bb648c.
//
// Solidity: event Swap(address indexed sender, address indexed token, uint256 amount0In, uint256 amount0Out, uint256 amount1In, uint256 amount1Out, uint256 reserve0, uint256 reserve1, uint256 volume, uint256 volume24H)
func (_Bonding *BondingFilterer) FilterSwap(opts *bind.FilterOpts, sender []common.Address, token []common.Address) (*BondingSwapIterator, error) {
var senderRule []interface{}
for _, senderItem := range sender {
senderRule = append(senderRule, senderItem)
}
var tokenRule []interface{}
for _, tokenItem := range token {
tokenRule = append(tokenRule, tokenItem)
}
logs, sub, err := _Bonding.contract.FilterLogs(opts, "Swap", senderRule, tokenRule)
if err != nil {
return nil, err
}
return &BondingSwapIterator{contract: _Bonding.contract, event: "Swap", logs: logs, sub: sub}, nil
}
// WatchSwap is a free log subscription operation binding the contract event 0x3fe84e6df58344329a18c304c0110e2a518d8c1dfce228cd1f78d11c59bb648c.
//
// Solidity: event Swap(address indexed sender, address indexed token, uint256 amount0In, uint256 amount0Out, uint256 amount1In, uint256 amount1Out, uint256 reserve0, uint256 reserve1, uint256 volume, uint256 volume24H)
func (_Bonding *BondingFilterer) WatchSwap(opts *bind.WatchOpts, sink chan<- *BondingSwap, sender []common.Address, token []common.Address) (event.Subscription, error) {
var senderRule []interface{}
for _, senderItem := range sender {
senderRule = append(senderRule, senderItem)
}
var tokenRule []interface{}
for _, tokenItem := range token {
tokenRule = append(tokenRule, tokenItem)
}
logs, sub, err := _Bonding.contract.WatchLogs(opts, "Swap", senderRule, tokenRule)
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(BondingSwap)
if err := _Bonding.contract.UnpackLog(event, "Swap", 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
}
// ParseSwap is a log parse operation binding the contract event 0x3fe84e6df58344329a18c304c0110e2a518d8c1dfce228cd1f78d11c59bb648c.
//
// Solidity: event Swap(address indexed sender, address indexed token, uint256 amount0In, uint256 amount0Out, uint256 amount1In, uint256 amount1Out, uint256 reserve0, uint256 reserve1, uint256 volume, uint256 volume24H)
func (_Bonding *BondingFilterer) ParseSwap(log types.Log) (*BondingSwap, error) {
event := new(BondingSwap)
if err := _Bonding.contract.UnpackLog(event, "Swap", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// BondingUniswapPoolCreatedIterator is returned from FilterUniswapPoolCreated and is used to iterate over the raw logs and unpacked data for UniswapPoolCreated events raised by the Bonding contract.
type BondingUniswapPoolCreatedIterator struct {
Event *BondingUniswapPoolCreated // 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 *BondingUniswapPoolCreatedIterator) 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(BondingUniswapPoolCreated)
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(BondingUniswapPoolCreated)
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 *BondingUniswapPoolCreatedIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *BondingUniswapPoolCreatedIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// BondingUniswapPoolCreated represents a UniswapPoolCreated event raised by the Bonding contract.
type BondingUniswapPoolCreated struct {
AddedPool common.Address
Idx *big.Int
Raw types.Log // Blockchain specific contextual infos
}
// FilterUniswapPoolCreated is a free log retrieval operation binding the contract event 0x8d53bf6c9d9f9be70816fc7584d94606d35c594142cfbea02724eca530f28181.
//
// Solidity: event UniswapPoolCreated(address addedPool, uint256 idx)
func (_Bonding *BondingFilterer) FilterUniswapPoolCreated(opts *bind.FilterOpts) (*BondingUniswapPoolCreatedIterator, error) {
logs, sub, err := _Bonding.contract.FilterLogs(opts, "UniswapPoolCreated")
if err != nil {
return nil, err
}
return &BondingUniswapPoolCreatedIterator{contract: _Bonding.contract, event: "UniswapPoolCreated", logs: logs, sub: sub}, nil
}
// WatchUniswapPoolCreated is a free log subscription operation binding the contract event 0x8d53bf6c9d9f9be70816fc7584d94606d35c594142cfbea02724eca530f28181.
//
// Solidity: event UniswapPoolCreated(address addedPool, uint256 idx)
func (_Bonding *BondingFilterer) WatchUniswapPoolCreated(opts *bind.WatchOpts, sink chan<- *BondingUniswapPoolCreated) (event.Subscription, error) {
logs, sub, err := _Bonding.contract.WatchLogs(opts, "UniswapPoolCreated")
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(BondingUniswapPoolCreated)
if err := _Bonding.contract.UnpackLog(event, "UniswapPoolCreated", 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
}
// ParseUniswapPoolCreated is a log parse operation binding the contract event 0x8d53bf6c9d9f9be70816fc7584d94606d35c594142cfbea02724eca530f28181.
//
// Solidity: event UniswapPoolCreated(address addedPool, uint256 idx)
func (_Bonding *BondingFilterer) ParseUniswapPoolCreated(log types.Log) (*BondingUniswapPoolCreated, error) {
event := new(BondingUniswapPoolCreated)
if err := _Bonding.contract.UnpackLog(event, "UniswapPoolCreated", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
[
{
"inputs": [
{
"internalType": "address",
"name": "router_",
"type": "address"
},
{
"internalType": "address",
"name": "token0",
"type": "address"
},
{
"internalType": "address",
"name": "token1",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "ReentrancyGuardReentrantCall",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "SafeERC20FailedOperation",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "reserve0",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "reserve1",
"type": "uint256"
}
],
"name": "Mint",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "amount0In",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount0Out",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount1In",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount1Out",
"type": "uint256"
}
],
"name": "Swap",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "_user",
"type": "address"
},
{
"internalType": "address",
"name": "_token",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approval",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "assetBalance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "balance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getReserves",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "kLast",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "reserve0",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserve1",
"type": "uint256"
}
],
"name": "mint",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "priceALast",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "priceBLast",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "router",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount0In",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount0Out",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount1In",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount1Out",
"type": "uint256"
}
],
"name": "swap",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "tokenA",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "tokenB",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferAsset",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
\ No newline at end of file
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package pair
import (
"errors"
"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 (
_ = errors.New
_ = big.NewInt
_ = strings.NewReader
_ = ethereum.NotFound
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = event.NewSubscription
_ = abi.ConvertType
)
// PairMetaData contains all meta data concerning the Pair contract.
var PairMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ReentrancyGuardReentrantCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reserve0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reserve1\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1In\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1Out\",\"type\":\"uint256\"}],\"name\":\"Swap\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_user\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approval\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"assetBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getReserves\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"kLast\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"reserve0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserve1\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"priceALast\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"priceBLast\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"router\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0In\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1In\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Out\",\"type\":\"uint256\"}],\"name\":\"swap\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenA\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenB\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferAsset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
}
// PairABI is the input ABI used to generate the binding from.
// Deprecated: Use PairMetaData.ABI instead.
var PairABI = PairMetaData.ABI
// Pair is an auto generated Go binding around an Ethereum contract.
type Pair struct {
PairCaller // Read-only binding to the contract
PairTransactor // Write-only binding to the contract
PairFilterer // Log filterer for contract events
}
// PairCaller is an auto generated read-only Go binding around an Ethereum contract.
type PairCaller struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// PairTransactor is an auto generated write-only Go binding around an Ethereum contract.
type PairTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// PairFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
type PairFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// PairSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type PairSession struct {
Contract *Pair // 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
}
// PairCallerSession is an auto generated read-only Go binding around an Ethereum contract,
// with pre-set call options.
type PairCallerSession struct {
Contract *PairCaller // Generic contract caller binding to set the session for
CallOpts bind.CallOpts // Call options to use throughout this session
}
// PairTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
// with pre-set transact options.
type PairTransactorSession struct {
Contract *PairTransactor // Generic contract transactor binding to set the session for
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
// PairRaw is an auto generated low-level Go binding around an Ethereum contract.
type PairRaw struct {
Contract *Pair // Generic contract binding to access the raw methods on
}
// PairCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
type PairCallerRaw struct {
Contract *PairCaller // Generic read-only contract binding to access the raw methods on
}
// PairTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
type PairTransactorRaw struct {
Contract *PairTransactor // Generic write-only contract binding to access the raw methods on
}
// NewPair creates a new instance of Pair, bound to a specific deployed contract.
func NewPair(address common.Address, backend bind.ContractBackend) (*Pair, error) {
contract, err := bindPair(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &Pair{PairCaller: PairCaller{contract: contract}, PairTransactor: PairTransactor{contract: contract}, PairFilterer: PairFilterer{contract: contract}}, nil
}
// NewPairCaller creates a new read-only instance of Pair, bound to a specific deployed contract.
func NewPairCaller(address common.Address, caller bind.ContractCaller) (*PairCaller, error) {
contract, err := bindPair(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &PairCaller{contract: contract}, nil
}
// NewPairTransactor creates a new write-only instance of Pair, bound to a specific deployed contract.
func NewPairTransactor(address common.Address, transactor bind.ContractTransactor) (*PairTransactor, error) {
contract, err := bindPair(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &PairTransactor{contract: contract}, nil
}
// NewPairFilterer creates a new log filterer instance of Pair, bound to a specific deployed contract.
func NewPairFilterer(address common.Address, filterer bind.ContractFilterer) (*PairFilterer, error) {
contract, err := bindPair(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &PairFilterer{contract: contract}, nil
}
// bindPair binds a generic wrapper to an already deployed contract.
func bindPair(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := PairMetaData.GetAbi()
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 (_Pair *PairRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Pair.Contract.PairCaller.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 (_Pair *PairRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _Pair.Contract.PairTransactor.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_Pair *PairRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _Pair.Contract.PairTransactor.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 (_Pair *PairCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Pair.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 (_Pair *PairTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _Pair.Contract.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_Pair *PairTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _Pair.Contract.contract.Transact(opts, method, params...)
}
// AssetBalance is a free data retrieval call binding the contract method 0xc66f2455.
//
// Solidity: function assetBalance() view returns(uint256)
func (_Pair *PairCaller) AssetBalance(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Pair.contract.Call(opts, &out, "assetBalance")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// AssetBalance is a free data retrieval call binding the contract method 0xc66f2455.
//
// Solidity: function assetBalance() view returns(uint256)
func (_Pair *PairSession) AssetBalance() (*big.Int, error) {
return _Pair.Contract.AssetBalance(&_Pair.CallOpts)
}
// AssetBalance is a free data retrieval call binding the contract method 0xc66f2455.
//
// Solidity: function assetBalance() view returns(uint256)
func (_Pair *PairCallerSession) AssetBalance() (*big.Int, error) {
return _Pair.Contract.AssetBalance(&_Pair.CallOpts)
}
// Balance is a free data retrieval call binding the contract method 0xb69ef8a8.
//
// Solidity: function balance() view returns(uint256)
func (_Pair *PairCaller) Balance(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Pair.contract.Call(opts, &out, "balance")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// Balance is a free data retrieval call binding the contract method 0xb69ef8a8.
//
// Solidity: function balance() view returns(uint256)
func (_Pair *PairSession) Balance() (*big.Int, error) {
return _Pair.Contract.Balance(&_Pair.CallOpts)
}
// Balance is a free data retrieval call binding the contract method 0xb69ef8a8.
//
// Solidity: function balance() view returns(uint256)
func (_Pair *PairCallerSession) Balance() (*big.Int, error) {
return _Pair.Contract.Balance(&_Pair.CallOpts)
}
// GetReserves is a free data retrieval call binding the contract method 0x0902f1ac.
//
// Solidity: function getReserves() view returns(uint256, uint256)
func (_Pair *PairCaller) GetReserves(opts *bind.CallOpts) (*big.Int, *big.Int, error) {
var out []interface{}
err := _Pair.contract.Call(opts, &out, "getReserves")
if err != nil {
return *new(*big.Int), *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int)
return out0, out1, err
}
// GetReserves is a free data retrieval call binding the contract method 0x0902f1ac.
//
// Solidity: function getReserves() view returns(uint256, uint256)
func (_Pair *PairSession) GetReserves() (*big.Int, *big.Int, error) {
return _Pair.Contract.GetReserves(&_Pair.CallOpts)
}
// GetReserves is a free data retrieval call binding the contract method 0x0902f1ac.
//
// Solidity: function getReserves() view returns(uint256, uint256)
func (_Pair *PairCallerSession) GetReserves() (*big.Int, *big.Int, error) {
return _Pair.Contract.GetReserves(&_Pair.CallOpts)
}
// KLast is a free data retrieval call binding the contract method 0x7464fc3d.
//
// Solidity: function kLast() view returns(uint256)
func (_Pair *PairCaller) KLast(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Pair.contract.Call(opts, &out, "kLast")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// KLast is a free data retrieval call binding the contract method 0x7464fc3d.
//
// Solidity: function kLast() view returns(uint256)
func (_Pair *PairSession) KLast() (*big.Int, error) {
return _Pair.Contract.KLast(&_Pair.CallOpts)
}
// KLast is a free data retrieval call binding the contract method 0x7464fc3d.
//
// Solidity: function kLast() view returns(uint256)
func (_Pair *PairCallerSession) KLast() (*big.Int, error) {
return _Pair.Contract.KLast(&_Pair.CallOpts)
}
// PriceALast is a free data retrieval call binding the contract method 0x5c9d6938.
//
// Solidity: function priceALast() view returns(uint256)
func (_Pair *PairCaller) PriceALast(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Pair.contract.Call(opts, &out, "priceALast")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// PriceALast is a free data retrieval call binding the contract method 0x5c9d6938.
//
// Solidity: function priceALast() view returns(uint256)
func (_Pair *PairSession) PriceALast() (*big.Int, error) {
return _Pair.Contract.PriceALast(&_Pair.CallOpts)
}
// PriceALast is a free data retrieval call binding the contract method 0x5c9d6938.
//
// Solidity: function priceALast() view returns(uint256)
func (_Pair *PairCallerSession) PriceALast() (*big.Int, error) {
return _Pair.Contract.PriceALast(&_Pair.CallOpts)
}
// PriceBLast is a free data retrieval call binding the contract method 0x0e06dfc9.
//
// Solidity: function priceBLast() view returns(uint256)
func (_Pair *PairCaller) PriceBLast(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Pair.contract.Call(opts, &out, "priceBLast")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// PriceBLast is a free data retrieval call binding the contract method 0x0e06dfc9.
//
// Solidity: function priceBLast() view returns(uint256)
func (_Pair *PairSession) PriceBLast() (*big.Int, error) {
return _Pair.Contract.PriceBLast(&_Pair.CallOpts)
}
// PriceBLast is a free data retrieval call binding the contract method 0x0e06dfc9.
//
// Solidity: function priceBLast() view returns(uint256)
func (_Pair *PairCallerSession) PriceBLast() (*big.Int, error) {
return _Pair.Contract.PriceBLast(&_Pair.CallOpts)
}
// Router is a free data retrieval call binding the contract method 0xf887ea40.
//
// Solidity: function router() view returns(address)
func (_Pair *PairCaller) Router(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _Pair.contract.Call(opts, &out, "router")
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// Router is a free data retrieval call binding the contract method 0xf887ea40.
//
// Solidity: function router() view returns(address)
func (_Pair *PairSession) Router() (common.Address, error) {
return _Pair.Contract.Router(&_Pair.CallOpts)
}
// Router is a free data retrieval call binding the contract method 0xf887ea40.
//
// Solidity: function router() view returns(address)
func (_Pair *PairCallerSession) Router() (common.Address, error) {
return _Pair.Contract.Router(&_Pair.CallOpts)
}
// TokenA is a free data retrieval call binding the contract method 0x0fc63d10.
//
// Solidity: function tokenA() view returns(address)
func (_Pair *PairCaller) TokenA(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _Pair.contract.Call(opts, &out, "tokenA")
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// TokenA is a free data retrieval call binding the contract method 0x0fc63d10.
//
// Solidity: function tokenA() view returns(address)
func (_Pair *PairSession) TokenA() (common.Address, error) {
return _Pair.Contract.TokenA(&_Pair.CallOpts)
}
// TokenA is a free data retrieval call binding the contract method 0x0fc63d10.
//
// Solidity: function tokenA() view returns(address)
func (_Pair *PairCallerSession) TokenA() (common.Address, error) {
return _Pair.Contract.TokenA(&_Pair.CallOpts)
}
// TokenB is a free data retrieval call binding the contract method 0x5f64b55b.
//
// Solidity: function tokenB() view returns(address)
func (_Pair *PairCaller) TokenB(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _Pair.contract.Call(opts, &out, "tokenB")
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// TokenB is a free data retrieval call binding the contract method 0x5f64b55b.
//
// Solidity: function tokenB() view returns(address)
func (_Pair *PairSession) TokenB() (common.Address, error) {
return _Pair.Contract.TokenB(&_Pair.CallOpts)
}
// TokenB is a free data retrieval call binding the contract method 0x5f64b55b.
//
// Solidity: function tokenB() view returns(address)
func (_Pair *PairCallerSession) TokenB() (common.Address, error) {
return _Pair.Contract.TokenB(&_Pair.CallOpts)
}
// Approval is a paid mutator transaction binding the contract method 0x5c52a5f2.
//
// Solidity: function approval(address _user, address _token, uint256 amount) returns(bool)
func (_Pair *PairTransactor) Approval(opts *bind.TransactOpts, _user common.Address, _token common.Address, amount *big.Int) (*types.Transaction, error) {
return _Pair.contract.Transact(opts, "approval", _user, _token, amount)
}
// Approval is a paid mutator transaction binding the contract method 0x5c52a5f2.
//
// Solidity: function approval(address _user, address _token, uint256 amount) returns(bool)
func (_Pair *PairSession) Approval(_user common.Address, _token common.Address, amount *big.Int) (*types.Transaction, error) {
return _Pair.Contract.Approval(&_Pair.TransactOpts, _user, _token, amount)
}
// Approval is a paid mutator transaction binding the contract method 0x5c52a5f2.
//
// Solidity: function approval(address _user, address _token, uint256 amount) returns(bool)
func (_Pair *PairTransactorSession) Approval(_user common.Address, _token common.Address, amount *big.Int) (*types.Transaction, error) {
return _Pair.Contract.Approval(&_Pair.TransactOpts, _user, _token, amount)
}
// Mint is a paid mutator transaction binding the contract method 0x1b2ef1ca.
//
// Solidity: function mint(uint256 reserve0, uint256 reserve1) returns(bool)
func (_Pair *PairTransactor) Mint(opts *bind.TransactOpts, reserve0 *big.Int, reserve1 *big.Int) (*types.Transaction, error) {
return _Pair.contract.Transact(opts, "mint", reserve0, reserve1)
}
// Mint is a paid mutator transaction binding the contract method 0x1b2ef1ca.
//
// Solidity: function mint(uint256 reserve0, uint256 reserve1) returns(bool)
func (_Pair *PairSession) Mint(reserve0 *big.Int, reserve1 *big.Int) (*types.Transaction, error) {
return _Pair.Contract.Mint(&_Pair.TransactOpts, reserve0, reserve1)
}
// Mint is a paid mutator transaction binding the contract method 0x1b2ef1ca.
//
// Solidity: function mint(uint256 reserve0, uint256 reserve1) returns(bool)
func (_Pair *PairTransactorSession) Mint(reserve0 *big.Int, reserve1 *big.Int) (*types.Transaction, error) {
return _Pair.Contract.Mint(&_Pair.TransactOpts, reserve0, reserve1)
}
// Swap is a paid mutator transaction binding the contract method 0x5673b02d.
//
// Solidity: function swap(uint256 amount0In, uint256 amount0Out, uint256 amount1In, uint256 amount1Out) returns(bool)
func (_Pair *PairTransactor) Swap(opts *bind.TransactOpts, amount0In *big.Int, amount0Out *big.Int, amount1In *big.Int, amount1Out *big.Int) (*types.Transaction, error) {
return _Pair.contract.Transact(opts, "swap", amount0In, amount0Out, amount1In, amount1Out)
}
// Swap is a paid mutator transaction binding the contract method 0x5673b02d.
//
// Solidity: function swap(uint256 amount0In, uint256 amount0Out, uint256 amount1In, uint256 amount1Out) returns(bool)
func (_Pair *PairSession) Swap(amount0In *big.Int, amount0Out *big.Int, amount1In *big.Int, amount1Out *big.Int) (*types.Transaction, error) {
return _Pair.Contract.Swap(&_Pair.TransactOpts, amount0In, amount0Out, amount1In, amount1Out)
}
// Swap is a paid mutator transaction binding the contract method 0x5673b02d.
//
// Solidity: function swap(uint256 amount0In, uint256 amount0Out, uint256 amount1In, uint256 amount1Out) returns(bool)
func (_Pair *PairTransactorSession) Swap(amount0In *big.Int, amount0Out *big.Int, amount1In *big.Int, amount1Out *big.Int) (*types.Transaction, error) {
return _Pair.Contract.Swap(&_Pair.TransactOpts, amount0In, amount0Out, amount1In, amount1Out)
}
// TransferAsset is a paid mutator transaction binding the contract method 0x5c921eb9.
//
// Solidity: function transferAsset(address recipient, uint256 amount) returns()
func (_Pair *PairTransactor) TransferAsset(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) {
return _Pair.contract.Transact(opts, "transferAsset", recipient, amount)
}
// TransferAsset is a paid mutator transaction binding the contract method 0x5c921eb9.
//
// Solidity: function transferAsset(address recipient, uint256 amount) returns()
func (_Pair *PairSession) TransferAsset(recipient common.Address, amount *big.Int) (*types.Transaction, error) {
return _Pair.Contract.TransferAsset(&_Pair.TransactOpts, recipient, amount)
}
// TransferAsset is a paid mutator transaction binding the contract method 0x5c921eb9.
//
// Solidity: function transferAsset(address recipient, uint256 amount) returns()
func (_Pair *PairTransactorSession) TransferAsset(recipient common.Address, amount *big.Int) (*types.Transaction, error) {
return _Pair.Contract.TransferAsset(&_Pair.TransactOpts, recipient, amount)
}
// TransferTo is a paid mutator transaction binding the contract method 0x2ccb1b30.
//
// Solidity: function transferTo(address recipient, uint256 amount) returns()
func (_Pair *PairTransactor) TransferTo(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) {
return _Pair.contract.Transact(opts, "transferTo", recipient, amount)
}
// TransferTo is a paid mutator transaction binding the contract method 0x2ccb1b30.
//
// Solidity: function transferTo(address recipient, uint256 amount) returns()
func (_Pair *PairSession) TransferTo(recipient common.Address, amount *big.Int) (*types.Transaction, error) {
return _Pair.Contract.TransferTo(&_Pair.TransactOpts, recipient, amount)
}
// TransferTo is a paid mutator transaction binding the contract method 0x2ccb1b30.
//
// Solidity: function transferTo(address recipient, uint256 amount) returns()
func (_Pair *PairTransactorSession) TransferTo(recipient common.Address, amount *big.Int) (*types.Transaction, error) {
return _Pair.Contract.TransferTo(&_Pair.TransactOpts, recipient, amount)
}
// PairMintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the Pair contract.
type PairMintIterator struct {
Event *PairMint // 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 *PairMintIterator) 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(PairMint)
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(PairMint)
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 *PairMintIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *PairMintIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// PairMint represents a Mint event raised by the Pair contract.
type PairMint struct {
Reserve0 *big.Int
Reserve1 *big.Int
Raw types.Log // Blockchain specific contextual infos
}
// FilterMint is a free log retrieval operation binding the contract event 0xcc9c58b575eabd3f6a1ee653e91fcea3ff546867ffc3782a3bbca1f9b6dbb8df.
//
// Solidity: event Mint(uint256 reserve0, uint256 reserve1)
func (_Pair *PairFilterer) FilterMint(opts *bind.FilterOpts) (*PairMintIterator, error) {
logs, sub, err := _Pair.contract.FilterLogs(opts, "Mint")
if err != nil {
return nil, err
}
return &PairMintIterator{contract: _Pair.contract, event: "Mint", logs: logs, sub: sub}, nil
}
// WatchMint is a free log subscription operation binding the contract event 0xcc9c58b575eabd3f6a1ee653e91fcea3ff546867ffc3782a3bbca1f9b6dbb8df.
//
// Solidity: event Mint(uint256 reserve0, uint256 reserve1)
func (_Pair *PairFilterer) WatchMint(opts *bind.WatchOpts, sink chan<- *PairMint) (event.Subscription, error) {
logs, sub, err := _Pair.contract.WatchLogs(opts, "Mint")
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(PairMint)
if err := _Pair.contract.UnpackLog(event, "Mint", 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
}
// ParseMint is a log parse operation binding the contract event 0xcc9c58b575eabd3f6a1ee653e91fcea3ff546867ffc3782a3bbca1f9b6dbb8df.
//
// Solidity: event Mint(uint256 reserve0, uint256 reserve1)
func (_Pair *PairFilterer) ParseMint(log types.Log) (*PairMint, error) {
event := new(PairMint)
if err := _Pair.contract.UnpackLog(event, "Mint", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// PairSwapIterator is returned from FilterSwap and is used to iterate over the raw logs and unpacked data for Swap events raised by the Pair contract.
type PairSwapIterator struct {
Event *PairSwap // 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 *PairSwapIterator) 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(PairSwap)
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(PairSwap)
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 *PairSwapIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *PairSwapIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// PairSwap represents a Swap event raised by the Pair contract.
type PairSwap struct {
Amount0In *big.Int
Amount0Out *big.Int
Amount1In *big.Int
Amount1Out *big.Int
Raw types.Log // Blockchain specific contextual infos
}
// FilterSwap is a free log retrieval operation binding the contract event 0x298c349c742327269dc8de6ad66687767310c948ea309df826f5bd103e19d207.
//
// Solidity: event Swap(uint256 amount0In, uint256 amount0Out, uint256 amount1In, uint256 amount1Out)
func (_Pair *PairFilterer) FilterSwap(opts *bind.FilterOpts) (*PairSwapIterator, error) {
logs, sub, err := _Pair.contract.FilterLogs(opts, "Swap")
if err != nil {
return nil, err
}
return &PairSwapIterator{contract: _Pair.contract, event: "Swap", logs: logs, sub: sub}, nil
}
// WatchSwap is a free log subscription operation binding the contract event 0x298c349c742327269dc8de6ad66687767310c948ea309df826f5bd103e19d207.
//
// Solidity: event Swap(uint256 amount0In, uint256 amount0Out, uint256 amount1In, uint256 amount1Out)
func (_Pair *PairFilterer) WatchSwap(opts *bind.WatchOpts, sink chan<- *PairSwap) (event.Subscription, error) {
logs, sub, err := _Pair.contract.WatchLogs(opts, "Swap")
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(PairSwap)
if err := _Pair.contract.UnpackLog(event, "Swap", 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
}
// ParseSwap is a log parse operation binding the contract event 0x298c349c742327269dc8de6ad66687767310c948ea309df826f5bd103e19d207.
//
// Solidity: event Swap(uint256 amount0In, uint256 amount0Out, uint256 amount1In, uint256 amount1Out)
func (_Pair *PairFilterer) ParseSwap(log types.Log) (*PairSwap, error) {
event := new(PairSwap)
if err := _Pair.contract.UnpackLog(event, "Swap", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_upgradedAddress","type":"address"}],"name":"deprecate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"deprecated","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_evilUser","type":"address"}],"name":"addBlackList","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply2","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"upgradedAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maximumFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"_totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_maker","type":"address"}],"name":"getBlackListStatus","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowed","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newBasisPoints","type":"uint256"},{"name":"newMaxFee","type":"uint256"}],"name":"setParams","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"issue","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"redeem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"basisPointsRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"isBlackListed","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_clearedUser","type":"address"}],"name":"removeBlackList","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"MAX_UINT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_blackListedUser","type":"address"}],"name":"destroyBlackFunds","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_initialSupply","type":"uint256"},{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_decimals","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Issue","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newAddress","type":"address"}],"name":"Deprecate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"feeBasisPoints","type":"uint256"},{"indexed":false,"name":"maxFee","type":"uint256"}],"name":"Params","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_blackListedUser","type":"address"},{"indexed":false,"name":"_balance","type":"uint256"}],"name":"DestroyedBlackFunds","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_user","type":"address"}],"name":"AddedBlackList","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_user","type":"address"}],"name":"RemovedBlackList","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"}]
\ No newline at end of file
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package token
import (
"errors"
"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 (
_ = errors.New
_ = big.NewInt
_ = strings.NewReader
_ = ethereum.NotFound
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = event.NewSubscription
_ = abi.ConvertType
)
// TokenMetaData contains all meta data concerning the Token contract.
var TokenMetaData = &bind.MetaData{
ABI: "[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_upgradedAddress\",\"type\":\"address\"}],\"name\":\"deprecate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"deprecated\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_evilUser\",\"type\":\"address\"}],\"name\":\"addBlackList\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply2\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"upgradedAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"balances\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"maximumFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"_totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_maker\",\"type\":\"address\"}],\"name\":\"getBlackListStatus\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowed\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"who\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getOwner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newBasisPoints\",\"type\":\"uint256\"},{\"name\":\"newMaxFee\",\"type\":\"uint256\"}],\"name\":\"setParams\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"issue\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"redeem\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"remaining\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"basisPointsRate\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"isBlackListed\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_clearedUser\",\"type\":\"address\"}],\"name\":\"removeBlackList\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_UINT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_blackListedUser\",\"type\":\"address\"}],\"name\":\"destroyBlackFunds\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_initialSupply\",\"type\":\"uint256\"},{\"name\":\"_name\",\"type\":\"string\"},{\"name\":\"_symbol\",\"type\":\"string\"},{\"name\":\"_decimals\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Issue\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Redeem\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"Deprecate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"feeBasisPoints\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"maxFee\",\"type\":\"uint256\"}],\"name\":\"Params\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_blackListedUser\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_balance\",\"type\":\"uint256\"}],\"name\":\"DestroyedBlackFunds\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_user\",\"type\":\"address\"}],\"name\":\"AddedBlackList\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_user\",\"type\":\"address\"}],\"name\":\"RemovedBlackList\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"Pause\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"Unpause\",\"type\":\"event\"}]",
}
// TokenABI is the input ABI used to generate the binding from.
// Deprecated: Use TokenMetaData.ABI instead.
var TokenABI = TokenMetaData.ABI
// Token is an auto generated Go binding around an Ethereum contract.
type Token struct {
TokenCaller // Read-only binding to the contract
TokenTransactor // Write-only binding to the contract
TokenFilterer // Log filterer for contract events
}
// TokenCaller is an auto generated read-only Go binding around an Ethereum contract.
type TokenCaller struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// TokenTransactor is an auto generated write-only Go binding around an Ethereum contract.
type TokenTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// TokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
type TokenFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// TokenSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type TokenSession struct {
Contract *Token // 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
}
// TokenCallerSession is an auto generated read-only Go binding around an Ethereum contract,
// with pre-set call options.
type TokenCallerSession struct {
Contract *TokenCaller // Generic contract caller binding to set the session for
CallOpts bind.CallOpts // Call options to use throughout this session
}
// TokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
// with pre-set transact options.
type TokenTransactorSession struct {
Contract *TokenTransactor // Generic contract transactor binding to set the session for
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
// TokenRaw is an auto generated low-level Go binding around an Ethereum contract.
type TokenRaw struct {
Contract *Token // Generic contract binding to access the raw methods on
}
// TokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
type TokenCallerRaw struct {
Contract *TokenCaller // Generic read-only contract binding to access the raw methods on
}
// TokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
type TokenTransactorRaw struct {
Contract *TokenTransactor // Generic write-only contract binding to access the raw methods on
}
// NewToken creates a new instance of Token, bound to a specific deployed contract.
func NewToken(address common.Address, backend bind.ContractBackend) (*Token, error) {
contract, err := bindToken(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &Token{TokenCaller: TokenCaller{contract: contract}, TokenTransactor: TokenTransactor{contract: contract}, TokenFilterer: TokenFilterer{contract: contract}}, nil
}
// NewTokenCaller creates a new read-only instance of Token, bound to a specific deployed contract.
func NewTokenCaller(address common.Address, caller bind.ContractCaller) (*TokenCaller, error) {
contract, err := bindToken(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &TokenCaller{contract: contract}, nil
}
// NewTokenTransactor creates a new write-only instance of Token, bound to a specific deployed contract.
func NewTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*TokenTransactor, error) {
contract, err := bindToken(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &TokenTransactor{contract: contract}, nil
}
// NewTokenFilterer creates a new log filterer instance of Token, bound to a specific deployed contract.
func NewTokenFilterer(address common.Address, filterer bind.ContractFilterer) (*TokenFilterer, error) {
contract, err := bindToken(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &TokenFilterer{contract: contract}, nil
}
// bindToken binds a generic wrapper to an already deployed contract.
func bindToken(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := TokenMetaData.GetAbi()
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 (_Token *TokenRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Token.Contract.TokenCaller.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 (_Token *TokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _Token.Contract.TokenTransactor.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_Token *TokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _Token.Contract.TokenTransactor.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 (_Token *TokenCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Token.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 (_Token *TokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _Token.Contract.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_Token *TokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _Token.Contract.contract.Transact(opts, method, params...)
}
// MAXUINT is a free data retrieval call binding the contract method 0xe5b5019a.
//
// Solidity: function MAX_UINT() view returns(uint256)
func (_Token *TokenCaller) MAXUINT(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "MAX_UINT")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// MAXUINT is a free data retrieval call binding the contract method 0xe5b5019a.
//
// Solidity: function MAX_UINT() view returns(uint256)
func (_Token *TokenSession) MAXUINT() (*big.Int, error) {
return _Token.Contract.MAXUINT(&_Token.CallOpts)
}
// MAXUINT is a free data retrieval call binding the contract method 0xe5b5019a.
//
// Solidity: function MAX_UINT() view returns(uint256)
func (_Token *TokenCallerSession) MAXUINT() (*big.Int, error) {
return _Token.Contract.MAXUINT(&_Token.CallOpts)
}
// TotalSupply is a free data retrieval call binding the contract method 0x3eaaf86b.
//
// Solidity: function _totalSupply() view returns(uint256)
func (_Token *TokenCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "_totalSupply")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// TotalSupply is a free data retrieval call binding the contract method 0x3eaaf86b.
//
// Solidity: function _totalSupply() view returns(uint256)
func (_Token *TokenSession) TotalSupply() (*big.Int, error) {
return _Token.Contract.TotalSupply(&_Token.CallOpts)
}
// TotalSupply is a free data retrieval call binding the contract method 0x3eaaf86b.
//
// Solidity: function _totalSupply() view returns(uint256)
func (_Token *TokenCallerSession) TotalSupply() (*big.Int, error) {
return _Token.Contract.TotalSupply(&_Token.CallOpts)
}
// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
//
// Solidity: function allowance(address _owner, address _spender) view returns(uint256 remaining)
func (_Token *TokenCaller) Allowance(opts *bind.CallOpts, _owner common.Address, _spender common.Address) (*big.Int, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "allowance", _owner, _spender)
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
//
// Solidity: function allowance(address _owner, address _spender) view returns(uint256 remaining)
func (_Token *TokenSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) {
return _Token.Contract.Allowance(&_Token.CallOpts, _owner, _spender)
}
// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
//
// Solidity: function allowance(address _owner, address _spender) view returns(uint256 remaining)
func (_Token *TokenCallerSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) {
return _Token.Contract.Allowance(&_Token.CallOpts, _owner, _spender)
}
// Allowed is a free data retrieval call binding the contract method 0x5c658165.
//
// Solidity: function allowed(address , address ) view returns(uint256)
func (_Token *TokenCaller) Allowed(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "allowed", arg0, arg1)
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// Allowed is a free data retrieval call binding the contract method 0x5c658165.
//
// Solidity: function allowed(address , address ) view returns(uint256)
func (_Token *TokenSession) Allowed(arg0 common.Address, arg1 common.Address) (*big.Int, error) {
return _Token.Contract.Allowed(&_Token.CallOpts, arg0, arg1)
}
// Allowed is a free data retrieval call binding the contract method 0x5c658165.
//
// Solidity: function allowed(address , address ) view returns(uint256)
func (_Token *TokenCallerSession) Allowed(arg0 common.Address, arg1 common.Address) (*big.Int, error) {
return _Token.Contract.Allowed(&_Token.CallOpts, arg0, arg1)
}
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
//
// Solidity: function balanceOf(address who) view returns(uint256)
func (_Token *TokenCaller) BalanceOf(opts *bind.CallOpts, who common.Address) (*big.Int, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "balanceOf", who)
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
//
// Solidity: function balanceOf(address who) view returns(uint256)
func (_Token *TokenSession) BalanceOf(who common.Address) (*big.Int, error) {
return _Token.Contract.BalanceOf(&_Token.CallOpts, who)
}
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
//
// Solidity: function balanceOf(address who) view returns(uint256)
func (_Token *TokenCallerSession) BalanceOf(who common.Address) (*big.Int, error) {
return _Token.Contract.BalanceOf(&_Token.CallOpts, who)
}
// Balances is a free data retrieval call binding the contract method 0x27e235e3.
//
// Solidity: function balances(address ) view returns(uint256)
func (_Token *TokenCaller) Balances(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "balances", arg0)
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// Balances is a free data retrieval call binding the contract method 0x27e235e3.
//
// Solidity: function balances(address ) view returns(uint256)
func (_Token *TokenSession) Balances(arg0 common.Address) (*big.Int, error) {
return _Token.Contract.Balances(&_Token.CallOpts, arg0)
}
// Balances is a free data retrieval call binding the contract method 0x27e235e3.
//
// Solidity: function balances(address ) view returns(uint256)
func (_Token *TokenCallerSession) Balances(arg0 common.Address) (*big.Int, error) {
return _Token.Contract.Balances(&_Token.CallOpts, arg0)
}
// BasisPointsRate is a free data retrieval call binding the contract method 0xdd644f72.
//
// Solidity: function basisPointsRate() view returns(uint256)
func (_Token *TokenCaller) BasisPointsRate(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "basisPointsRate")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// BasisPointsRate is a free data retrieval call binding the contract method 0xdd644f72.
//
// Solidity: function basisPointsRate() view returns(uint256)
func (_Token *TokenSession) BasisPointsRate() (*big.Int, error) {
return _Token.Contract.BasisPointsRate(&_Token.CallOpts)
}
// BasisPointsRate is a free data retrieval call binding the contract method 0xdd644f72.
//
// Solidity: function basisPointsRate() view returns(uint256)
func (_Token *TokenCallerSession) BasisPointsRate() (*big.Int, error) {
return _Token.Contract.BasisPointsRate(&_Token.CallOpts)
}
// Decimals is a free data retrieval call binding the contract method 0x313ce567.
//
// Solidity: function decimals() view returns(uint256)
func (_Token *TokenCaller) Decimals(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "decimals")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// Decimals is a free data retrieval call binding the contract method 0x313ce567.
//
// Solidity: function decimals() view returns(uint256)
func (_Token *TokenSession) Decimals() (*big.Int, error) {
return _Token.Contract.Decimals(&_Token.CallOpts)
}
// Decimals is a free data retrieval call binding the contract method 0x313ce567.
//
// Solidity: function decimals() view returns(uint256)
func (_Token *TokenCallerSession) Decimals() (*big.Int, error) {
return _Token.Contract.Decimals(&_Token.CallOpts)
}
// Deprecated is a free data retrieval call binding the contract method 0x0e136b19.
//
// Solidity: function deprecated() view returns(bool)
func (_Token *TokenCaller) Deprecated(opts *bind.CallOpts) (bool, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "deprecated")
if err != nil {
return *new(bool), err
}
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
return out0, err
}
// Deprecated is a free data retrieval call binding the contract method 0x0e136b19.
//
// Solidity: function deprecated() view returns(bool)
func (_Token *TokenSession) Deprecated() (bool, error) {
return _Token.Contract.Deprecated(&_Token.CallOpts)
}
// Deprecated is a free data retrieval call binding the contract method 0x0e136b19.
//
// Solidity: function deprecated() view returns(bool)
func (_Token *TokenCallerSession) Deprecated() (bool, error) {
return _Token.Contract.Deprecated(&_Token.CallOpts)
}
// GetBlackListStatus is a free data retrieval call binding the contract method 0x59bf1abe.
//
// Solidity: function getBlackListStatus(address _maker) view returns(bool)
func (_Token *TokenCaller) GetBlackListStatus(opts *bind.CallOpts, _maker common.Address) (bool, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "getBlackListStatus", _maker)
if err != nil {
return *new(bool), err
}
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
return out0, err
}
// GetBlackListStatus is a free data retrieval call binding the contract method 0x59bf1abe.
//
// Solidity: function getBlackListStatus(address _maker) view returns(bool)
func (_Token *TokenSession) GetBlackListStatus(_maker common.Address) (bool, error) {
return _Token.Contract.GetBlackListStatus(&_Token.CallOpts, _maker)
}
// GetBlackListStatus is a free data retrieval call binding the contract method 0x59bf1abe.
//
// Solidity: function getBlackListStatus(address _maker) view returns(bool)
func (_Token *TokenCallerSession) GetBlackListStatus(_maker common.Address) (bool, error) {
return _Token.Contract.GetBlackListStatus(&_Token.CallOpts, _maker)
}
// GetOwner is a free data retrieval call binding the contract method 0x893d20e8.
//
// Solidity: function getOwner() view returns(address)
func (_Token *TokenCaller) GetOwner(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "getOwner")
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// GetOwner is a free data retrieval call binding the contract method 0x893d20e8.
//
// Solidity: function getOwner() view returns(address)
func (_Token *TokenSession) GetOwner() (common.Address, error) {
return _Token.Contract.GetOwner(&_Token.CallOpts)
}
// GetOwner is a free data retrieval call binding the contract method 0x893d20e8.
//
// Solidity: function getOwner() view returns(address)
func (_Token *TokenCallerSession) GetOwner() (common.Address, error) {
return _Token.Contract.GetOwner(&_Token.CallOpts)
}
// IsBlackListed is a free data retrieval call binding the contract method 0xe47d6060.
//
// Solidity: function isBlackListed(address ) view returns(bool)
func (_Token *TokenCaller) IsBlackListed(opts *bind.CallOpts, arg0 common.Address) (bool, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "isBlackListed", arg0)
if err != nil {
return *new(bool), err
}
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
return out0, err
}
// IsBlackListed is a free data retrieval call binding the contract method 0xe47d6060.
//
// Solidity: function isBlackListed(address ) view returns(bool)
func (_Token *TokenSession) IsBlackListed(arg0 common.Address) (bool, error) {
return _Token.Contract.IsBlackListed(&_Token.CallOpts, arg0)
}
// IsBlackListed is a free data retrieval call binding the contract method 0xe47d6060.
//
// Solidity: function isBlackListed(address ) view returns(bool)
func (_Token *TokenCallerSession) IsBlackListed(arg0 common.Address) (bool, error) {
return _Token.Contract.IsBlackListed(&_Token.CallOpts, arg0)
}
// MaximumFee is a free data retrieval call binding the contract method 0x35390714.
//
// Solidity: function maximumFee() view returns(uint256)
func (_Token *TokenCaller) MaximumFee(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "maximumFee")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// MaximumFee is a free data retrieval call binding the contract method 0x35390714.
//
// Solidity: function maximumFee() view returns(uint256)
func (_Token *TokenSession) MaximumFee() (*big.Int, error) {
return _Token.Contract.MaximumFee(&_Token.CallOpts)
}
// MaximumFee is a free data retrieval call binding the contract method 0x35390714.
//
// Solidity: function maximumFee() view returns(uint256)
func (_Token *TokenCallerSession) MaximumFee() (*big.Int, error) {
return _Token.Contract.MaximumFee(&_Token.CallOpts)
}
// Name is a free data retrieval call binding the contract method 0x06fdde03.
//
// Solidity: function name() view returns(string)
func (_Token *TokenCaller) Name(opts *bind.CallOpts) (string, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "name")
if err != nil {
return *new(string), err
}
out0 := *abi.ConvertType(out[0], new(string)).(*string)
return out0, err
}
// Name is a free data retrieval call binding the contract method 0x06fdde03.
//
// Solidity: function name() view returns(string)
func (_Token *TokenSession) Name() (string, error) {
return _Token.Contract.Name(&_Token.CallOpts)
}
// Name is a free data retrieval call binding the contract method 0x06fdde03.
//
// Solidity: function name() view returns(string)
func (_Token *TokenCallerSession) Name() (string, error) {
return _Token.Contract.Name(&_Token.CallOpts)
}
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
//
// Solidity: function owner() view returns(address)
func (_Token *TokenCaller) Owner(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _Token.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 (_Token *TokenSession) Owner() (common.Address, error) {
return _Token.Contract.Owner(&_Token.CallOpts)
}
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
//
// Solidity: function owner() view returns(address)
func (_Token *TokenCallerSession) Owner() (common.Address, error) {
return _Token.Contract.Owner(&_Token.CallOpts)
}
// Paused is a free data retrieval call binding the contract method 0x5c975abb.
//
// Solidity: function paused() view returns(bool)
func (_Token *TokenCaller) Paused(opts *bind.CallOpts) (bool, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "paused")
if err != nil {
return *new(bool), err
}
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
return out0, err
}
// Paused is a free data retrieval call binding the contract method 0x5c975abb.
//
// Solidity: function paused() view returns(bool)
func (_Token *TokenSession) Paused() (bool, error) {
return _Token.Contract.Paused(&_Token.CallOpts)
}
// Paused is a free data retrieval call binding the contract method 0x5c975abb.
//
// Solidity: function paused() view returns(bool)
func (_Token *TokenCallerSession) Paused() (bool, error) {
return _Token.Contract.Paused(&_Token.CallOpts)
}
// Symbol is a free data retrieval call binding the contract method 0x95d89b41.
//
// Solidity: function symbol() view returns(string)
func (_Token *TokenCaller) Symbol(opts *bind.CallOpts) (string, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "symbol")
if err != nil {
return *new(string), err
}
out0 := *abi.ConvertType(out[0], new(string)).(*string)
return out0, err
}
// Symbol is a free data retrieval call binding the contract method 0x95d89b41.
//
// Solidity: function symbol() view returns(string)
func (_Token *TokenSession) Symbol() (string, error) {
return _Token.Contract.Symbol(&_Token.CallOpts)
}
// Symbol is a free data retrieval call binding the contract method 0x95d89b41.
//
// Solidity: function symbol() view returns(string)
func (_Token *TokenCallerSession) Symbol() (string, error) {
return _Token.Contract.Symbol(&_Token.CallOpts)
}
// TotalSupply2 is a free data retrieval call binding the contract method 0x96178c20.
//
// Solidity: function totalSupply2() view returns(uint256)
func (_Token *TokenCaller) TotalSupply2(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "totalSupply2")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// TotalSupply2 is a free data retrieval call binding the contract method 0x96178c20.
//
// Solidity: function totalSupply2() view returns(uint256)
func (_Token *TokenSession) TotalSupply2() (*big.Int, error) {
return _Token.Contract.TotalSupply2(&_Token.CallOpts)
}
// TotalSupply2 is a free data retrieval call binding the contract method 0x96178c20.
//
// Solidity: function totalSupply2() view returns(uint256)
func (_Token *TokenCallerSession) TotalSupply2() (*big.Int, error) {
return _Token.Contract.TotalSupply2(&_Token.CallOpts)
}
// UpgradedAddress is a free data retrieval call binding the contract method 0x26976e3f.
//
// Solidity: function upgradedAddress() view returns(address)
func (_Token *TokenCaller) UpgradedAddress(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _Token.contract.Call(opts, &out, "upgradedAddress")
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// UpgradedAddress is a free data retrieval call binding the contract method 0x26976e3f.
//
// Solidity: function upgradedAddress() view returns(address)
func (_Token *TokenSession) UpgradedAddress() (common.Address, error) {
return _Token.Contract.UpgradedAddress(&_Token.CallOpts)
}
// UpgradedAddress is a free data retrieval call binding the contract method 0x26976e3f.
//
// Solidity: function upgradedAddress() view returns(address)
func (_Token *TokenCallerSession) UpgradedAddress() (common.Address, error) {
return _Token.Contract.UpgradedAddress(&_Token.CallOpts)
}
// AddBlackList is a paid mutator transaction binding the contract method 0x0ecb93c0.
//
// Solidity: function addBlackList(address _evilUser) returns()
func (_Token *TokenTransactor) AddBlackList(opts *bind.TransactOpts, _evilUser common.Address) (*types.Transaction, error) {
return _Token.contract.Transact(opts, "addBlackList", _evilUser)
}
// AddBlackList is a paid mutator transaction binding the contract method 0x0ecb93c0.
//
// Solidity: function addBlackList(address _evilUser) returns()
func (_Token *TokenSession) AddBlackList(_evilUser common.Address) (*types.Transaction, error) {
return _Token.Contract.AddBlackList(&_Token.TransactOpts, _evilUser)
}
// AddBlackList is a paid mutator transaction binding the contract method 0x0ecb93c0.
//
// Solidity: function addBlackList(address _evilUser) returns()
func (_Token *TokenTransactorSession) AddBlackList(_evilUser common.Address) (*types.Transaction, error) {
return _Token.Contract.AddBlackList(&_Token.TransactOpts, _evilUser)
}
// Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
//
// Solidity: function approve(address _spender, uint256 _value) returns()
func (_Token *TokenTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {
return _Token.contract.Transact(opts, "approve", _spender, _value)
}
// Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
//
// Solidity: function approve(address _spender, uint256 _value) returns()
func (_Token *TokenSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {
return _Token.Contract.Approve(&_Token.TransactOpts, _spender, _value)
}
// Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
//
// Solidity: function approve(address _spender, uint256 _value) returns()
func (_Token *TokenTransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {
return _Token.Contract.Approve(&_Token.TransactOpts, _spender, _value)
}
// Deprecate is a paid mutator transaction binding the contract method 0x0753c30c.
//
// Solidity: function deprecate(address _upgradedAddress) returns()
func (_Token *TokenTransactor) Deprecate(opts *bind.TransactOpts, _upgradedAddress common.Address) (*types.Transaction, error) {
return _Token.contract.Transact(opts, "deprecate", _upgradedAddress)
}
// Deprecate is a paid mutator transaction binding the contract method 0x0753c30c.
//
// Solidity: function deprecate(address _upgradedAddress) returns()
func (_Token *TokenSession) Deprecate(_upgradedAddress common.Address) (*types.Transaction, error) {
return _Token.Contract.Deprecate(&_Token.TransactOpts, _upgradedAddress)
}
// Deprecate is a paid mutator transaction binding the contract method 0x0753c30c.
//
// Solidity: function deprecate(address _upgradedAddress) returns()
func (_Token *TokenTransactorSession) Deprecate(_upgradedAddress common.Address) (*types.Transaction, error) {
return _Token.Contract.Deprecate(&_Token.TransactOpts, _upgradedAddress)
}
// DestroyBlackFunds is a paid mutator transaction binding the contract method 0xf3bdc228.
//
// Solidity: function destroyBlackFunds(address _blackListedUser) returns()
func (_Token *TokenTransactor) DestroyBlackFunds(opts *bind.TransactOpts, _blackListedUser common.Address) (*types.Transaction, error) {
return _Token.contract.Transact(opts, "destroyBlackFunds", _blackListedUser)
}
// DestroyBlackFunds is a paid mutator transaction binding the contract method 0xf3bdc228.
//
// Solidity: function destroyBlackFunds(address _blackListedUser) returns()
func (_Token *TokenSession) DestroyBlackFunds(_blackListedUser common.Address) (*types.Transaction, error) {
return _Token.Contract.DestroyBlackFunds(&_Token.TransactOpts, _blackListedUser)
}
// DestroyBlackFunds is a paid mutator transaction binding the contract method 0xf3bdc228.
//
// Solidity: function destroyBlackFunds(address _blackListedUser) returns()
func (_Token *TokenTransactorSession) DestroyBlackFunds(_blackListedUser common.Address) (*types.Transaction, error) {
return _Token.Contract.DestroyBlackFunds(&_Token.TransactOpts, _blackListedUser)
}
// Issue is a paid mutator transaction binding the contract method 0xcc872b66.
//
// Solidity: function issue(uint256 amount) returns()
func (_Token *TokenTransactor) Issue(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) {
return _Token.contract.Transact(opts, "issue", amount)
}
// Issue is a paid mutator transaction binding the contract method 0xcc872b66.
//
// Solidity: function issue(uint256 amount) returns()
func (_Token *TokenSession) Issue(amount *big.Int) (*types.Transaction, error) {
return _Token.Contract.Issue(&_Token.TransactOpts, amount)
}
// Issue is a paid mutator transaction binding the contract method 0xcc872b66.
//
// Solidity: function issue(uint256 amount) returns()
func (_Token *TokenTransactorSession) Issue(amount *big.Int) (*types.Transaction, error) {
return _Token.Contract.Issue(&_Token.TransactOpts, amount)
}
// Pause is a paid mutator transaction binding the contract method 0x8456cb59.
//
// Solidity: function pause() returns()
func (_Token *TokenTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) {
return _Token.contract.Transact(opts, "pause")
}
// Pause is a paid mutator transaction binding the contract method 0x8456cb59.
//
// Solidity: function pause() returns()
func (_Token *TokenSession) Pause() (*types.Transaction, error) {
return _Token.Contract.Pause(&_Token.TransactOpts)
}
// Pause is a paid mutator transaction binding the contract method 0x8456cb59.
//
// Solidity: function pause() returns()
func (_Token *TokenTransactorSession) Pause() (*types.Transaction, error) {
return _Token.Contract.Pause(&_Token.TransactOpts)
}
// Redeem is a paid mutator transaction binding the contract method 0xdb006a75.
//
// Solidity: function redeem(uint256 amount) returns()
func (_Token *TokenTransactor) Redeem(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) {
return _Token.contract.Transact(opts, "redeem", amount)
}
// Redeem is a paid mutator transaction binding the contract method 0xdb006a75.
//
// Solidity: function redeem(uint256 amount) returns()
func (_Token *TokenSession) Redeem(amount *big.Int) (*types.Transaction, error) {
return _Token.Contract.Redeem(&_Token.TransactOpts, amount)
}
// Redeem is a paid mutator transaction binding the contract method 0xdb006a75.
//
// Solidity: function redeem(uint256 amount) returns()
func (_Token *TokenTransactorSession) Redeem(amount *big.Int) (*types.Transaction, error) {
return _Token.Contract.Redeem(&_Token.TransactOpts, amount)
}
// RemoveBlackList is a paid mutator transaction binding the contract method 0xe4997dc5.
//
// Solidity: function removeBlackList(address _clearedUser) returns()
func (_Token *TokenTransactor) RemoveBlackList(opts *bind.TransactOpts, _clearedUser common.Address) (*types.Transaction, error) {
return _Token.contract.Transact(opts, "removeBlackList", _clearedUser)
}
// RemoveBlackList is a paid mutator transaction binding the contract method 0xe4997dc5.
//
// Solidity: function removeBlackList(address _clearedUser) returns()
func (_Token *TokenSession) RemoveBlackList(_clearedUser common.Address) (*types.Transaction, error) {
return _Token.Contract.RemoveBlackList(&_Token.TransactOpts, _clearedUser)
}
// RemoveBlackList is a paid mutator transaction binding the contract method 0xe4997dc5.
//
// Solidity: function removeBlackList(address _clearedUser) returns()
func (_Token *TokenTransactorSession) RemoveBlackList(_clearedUser common.Address) (*types.Transaction, error) {
return _Token.Contract.RemoveBlackList(&_Token.TransactOpts, _clearedUser)
}
// SetParams is a paid mutator transaction binding the contract method 0xc0324c77.
//
// Solidity: function setParams(uint256 newBasisPoints, uint256 newMaxFee) returns()
func (_Token *TokenTransactor) SetParams(opts *bind.TransactOpts, newBasisPoints *big.Int, newMaxFee *big.Int) (*types.Transaction, error) {
return _Token.contract.Transact(opts, "setParams", newBasisPoints, newMaxFee)
}
// SetParams is a paid mutator transaction binding the contract method 0xc0324c77.
//
// Solidity: function setParams(uint256 newBasisPoints, uint256 newMaxFee) returns()
func (_Token *TokenSession) SetParams(newBasisPoints *big.Int, newMaxFee *big.Int) (*types.Transaction, error) {
return _Token.Contract.SetParams(&_Token.TransactOpts, newBasisPoints, newMaxFee)
}
// SetParams is a paid mutator transaction binding the contract method 0xc0324c77.
//
// Solidity: function setParams(uint256 newBasisPoints, uint256 newMaxFee) returns()
func (_Token *TokenTransactorSession) SetParams(newBasisPoints *big.Int, newMaxFee *big.Int) (*types.Transaction, error) {
return _Token.Contract.SetParams(&_Token.TransactOpts, newBasisPoints, newMaxFee)
}
// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
//
// Solidity: function transfer(address _to, uint256 _value) returns()
func (_Token *TokenTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) {
return _Token.contract.Transact(opts, "transfer", _to, _value)
}
// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
//
// Solidity: function transfer(address _to, uint256 _value) returns()
func (_Token *TokenSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) {
return _Token.Contract.Transfer(&_Token.TransactOpts, _to, _value)
}
// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
//
// Solidity: function transfer(address _to, uint256 _value) returns()
func (_Token *TokenTransactorSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) {
return _Token.Contract.Transfer(&_Token.TransactOpts, _to, _value)
}
// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd.
//
// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns()
func (_Token *TokenTransactor) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) {
return _Token.contract.Transact(opts, "transferFrom", _from, _to, _value)
}
// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd.
//
// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns()
func (_Token *TokenSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) {
return _Token.Contract.TransferFrom(&_Token.TransactOpts, _from, _to, _value)
}
// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd.
//
// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns()
func (_Token *TokenTransactorSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) {
return _Token.Contract.TransferFrom(&_Token.TransactOpts, _from, _to, _value)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_Token *TokenTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {
return _Token.contract.Transact(opts, "transferOwnership", newOwner)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_Token *TokenSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
return _Token.Contract.TransferOwnership(&_Token.TransactOpts, newOwner)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_Token *TokenTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
return _Token.Contract.TransferOwnership(&_Token.TransactOpts, newOwner)
}
// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a.
//
// Solidity: function unpause() returns()
func (_Token *TokenTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) {
return _Token.contract.Transact(opts, "unpause")
}
// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a.
//
// Solidity: function unpause() returns()
func (_Token *TokenSession) Unpause() (*types.Transaction, error) {
return _Token.Contract.Unpause(&_Token.TransactOpts)
}
// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a.
//
// Solidity: function unpause() returns()
func (_Token *TokenTransactorSession) Unpause() (*types.Transaction, error) {
return _Token.Contract.Unpause(&_Token.TransactOpts)
}
// TokenAddedBlackListIterator is returned from FilterAddedBlackList and is used to iterate over the raw logs and unpacked data for AddedBlackList events raised by the Token contract.
type TokenAddedBlackListIterator struct {
Event *TokenAddedBlackList // 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 *TokenAddedBlackListIterator) 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(TokenAddedBlackList)
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(TokenAddedBlackList)
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 *TokenAddedBlackListIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *TokenAddedBlackListIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// TokenAddedBlackList represents a AddedBlackList event raised by the Token contract.
type TokenAddedBlackList struct {
User common.Address
Raw types.Log // Blockchain specific contextual infos
}
// FilterAddedBlackList is a free log retrieval operation binding the contract event 0x42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc.
//
// Solidity: event AddedBlackList(address _user)
func (_Token *TokenFilterer) FilterAddedBlackList(opts *bind.FilterOpts) (*TokenAddedBlackListIterator, error) {
logs, sub, err := _Token.contract.FilterLogs(opts, "AddedBlackList")
if err != nil {
return nil, err
}
return &TokenAddedBlackListIterator{contract: _Token.contract, event: "AddedBlackList", logs: logs, sub: sub}, nil
}
// WatchAddedBlackList is a free log subscription operation binding the contract event 0x42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc.
//
// Solidity: event AddedBlackList(address _user)
func (_Token *TokenFilterer) WatchAddedBlackList(opts *bind.WatchOpts, sink chan<- *TokenAddedBlackList) (event.Subscription, error) {
logs, sub, err := _Token.contract.WatchLogs(opts, "AddedBlackList")
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(TokenAddedBlackList)
if err := _Token.contract.UnpackLog(event, "AddedBlackList", 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
}
// ParseAddedBlackList is a log parse operation binding the contract event 0x42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc.
//
// Solidity: event AddedBlackList(address _user)
func (_Token *TokenFilterer) ParseAddedBlackList(log types.Log) (*TokenAddedBlackList, error) {
event := new(TokenAddedBlackList)
if err := _Token.contract.UnpackLog(event, "AddedBlackList", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// TokenApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Token contract.
type TokenApprovalIterator struct {
Event *TokenApproval // 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 *TokenApprovalIterator) 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(TokenApproval)
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(TokenApproval)
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 *TokenApprovalIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *TokenApprovalIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// TokenApproval represents a Approval event raised by the Token contract.
type TokenApproval struct {
Owner common.Address
Spender common.Address
Value *big.Int
Raw types.Log // Blockchain specific contextual infos
}
// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
//
// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value)
func (_Token *TokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*TokenApprovalIterator, error) {
var ownerRule []interface{}
for _, ownerItem := range owner {
ownerRule = append(ownerRule, ownerItem)
}
var spenderRule []interface{}
for _, spenderItem := range spender {
spenderRule = append(spenderRule, spenderItem)
}
logs, sub, err := _Token.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule)
if err != nil {
return nil, err
}
return &TokenApprovalIterator{contract: _Token.contract, event: "Approval", logs: logs, sub: sub}, nil
}
// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
//
// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value)
func (_Token *TokenFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *TokenApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) {
var ownerRule []interface{}
for _, ownerItem := range owner {
ownerRule = append(ownerRule, ownerItem)
}
var spenderRule []interface{}
for _, spenderItem := range spender {
spenderRule = append(spenderRule, spenderItem)
}
logs, sub, err := _Token.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule)
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(TokenApproval)
if err := _Token.contract.UnpackLog(event, "Approval", 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
}
// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
//
// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value)
func (_Token *TokenFilterer) ParseApproval(log types.Log) (*TokenApproval, error) {
event := new(TokenApproval)
if err := _Token.contract.UnpackLog(event, "Approval", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// TokenDeprecateIterator is returned from FilterDeprecate and is used to iterate over the raw logs and unpacked data for Deprecate events raised by the Token contract.
type TokenDeprecateIterator struct {
Event *TokenDeprecate // 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 *TokenDeprecateIterator) 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(TokenDeprecate)
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(TokenDeprecate)
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 *TokenDeprecateIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *TokenDeprecateIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// TokenDeprecate represents a Deprecate event raised by the Token contract.
type TokenDeprecate struct {
NewAddress common.Address
Raw types.Log // Blockchain specific contextual infos
}
// FilterDeprecate is a free log retrieval operation binding the contract event 0xcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e.
//
// Solidity: event Deprecate(address newAddress)
func (_Token *TokenFilterer) FilterDeprecate(opts *bind.FilterOpts) (*TokenDeprecateIterator, error) {
logs, sub, err := _Token.contract.FilterLogs(opts, "Deprecate")
if err != nil {
return nil, err
}
return &TokenDeprecateIterator{contract: _Token.contract, event: "Deprecate", logs: logs, sub: sub}, nil
}
// WatchDeprecate is a free log subscription operation binding the contract event 0xcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e.
//
// Solidity: event Deprecate(address newAddress)
func (_Token *TokenFilterer) WatchDeprecate(opts *bind.WatchOpts, sink chan<- *TokenDeprecate) (event.Subscription, error) {
logs, sub, err := _Token.contract.WatchLogs(opts, "Deprecate")
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(TokenDeprecate)
if err := _Token.contract.UnpackLog(event, "Deprecate", 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
}
// ParseDeprecate is a log parse operation binding the contract event 0xcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e.
//
// Solidity: event Deprecate(address newAddress)
func (_Token *TokenFilterer) ParseDeprecate(log types.Log) (*TokenDeprecate, error) {
event := new(TokenDeprecate)
if err := _Token.contract.UnpackLog(event, "Deprecate", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// TokenDestroyedBlackFundsIterator is returned from FilterDestroyedBlackFunds and is used to iterate over the raw logs and unpacked data for DestroyedBlackFunds events raised by the Token contract.
type TokenDestroyedBlackFundsIterator struct {
Event *TokenDestroyedBlackFunds // 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 *TokenDestroyedBlackFundsIterator) 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(TokenDestroyedBlackFunds)
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(TokenDestroyedBlackFunds)
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 *TokenDestroyedBlackFundsIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *TokenDestroyedBlackFundsIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// TokenDestroyedBlackFunds represents a DestroyedBlackFunds event raised by the Token contract.
type TokenDestroyedBlackFunds struct {
BlackListedUser common.Address
Balance *big.Int
Raw types.Log // Blockchain specific contextual infos
}
// FilterDestroyedBlackFunds is a free log retrieval operation binding the contract event 0x61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c6.
//
// Solidity: event DestroyedBlackFunds(address _blackListedUser, uint256 _balance)
func (_Token *TokenFilterer) FilterDestroyedBlackFunds(opts *bind.FilterOpts) (*TokenDestroyedBlackFundsIterator, error) {
logs, sub, err := _Token.contract.FilterLogs(opts, "DestroyedBlackFunds")
if err != nil {
return nil, err
}
return &TokenDestroyedBlackFundsIterator{contract: _Token.contract, event: "DestroyedBlackFunds", logs: logs, sub: sub}, nil
}
// WatchDestroyedBlackFunds is a free log subscription operation binding the contract event 0x61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c6.
//
// Solidity: event DestroyedBlackFunds(address _blackListedUser, uint256 _balance)
func (_Token *TokenFilterer) WatchDestroyedBlackFunds(opts *bind.WatchOpts, sink chan<- *TokenDestroyedBlackFunds) (event.Subscription, error) {
logs, sub, err := _Token.contract.WatchLogs(opts, "DestroyedBlackFunds")
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(TokenDestroyedBlackFunds)
if err := _Token.contract.UnpackLog(event, "DestroyedBlackFunds", 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
}
// ParseDestroyedBlackFunds is a log parse operation binding the contract event 0x61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c6.
//
// Solidity: event DestroyedBlackFunds(address _blackListedUser, uint256 _balance)
func (_Token *TokenFilterer) ParseDestroyedBlackFunds(log types.Log) (*TokenDestroyedBlackFunds, error) {
event := new(TokenDestroyedBlackFunds)
if err := _Token.contract.UnpackLog(event, "DestroyedBlackFunds", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// TokenIssueIterator is returned from FilterIssue and is used to iterate over the raw logs and unpacked data for Issue events raised by the Token contract.
type TokenIssueIterator struct {
Event *TokenIssue // 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 *TokenIssueIterator) 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(TokenIssue)
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(TokenIssue)
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 *TokenIssueIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *TokenIssueIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// TokenIssue represents a Issue event raised by the Token contract.
type TokenIssue struct {
Amount *big.Int
Raw types.Log // Blockchain specific contextual infos
}
// FilterIssue is a free log retrieval operation binding the contract event 0xcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a.
//
// Solidity: event Issue(uint256 amount)
func (_Token *TokenFilterer) FilterIssue(opts *bind.FilterOpts) (*TokenIssueIterator, error) {
logs, sub, err := _Token.contract.FilterLogs(opts, "Issue")
if err != nil {
return nil, err
}
return &TokenIssueIterator{contract: _Token.contract, event: "Issue", logs: logs, sub: sub}, nil
}
// WatchIssue is a free log subscription operation binding the contract event 0xcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a.
//
// Solidity: event Issue(uint256 amount)
func (_Token *TokenFilterer) WatchIssue(opts *bind.WatchOpts, sink chan<- *TokenIssue) (event.Subscription, error) {
logs, sub, err := _Token.contract.WatchLogs(opts, "Issue")
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(TokenIssue)
if err := _Token.contract.UnpackLog(event, "Issue", 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
}
// ParseIssue is a log parse operation binding the contract event 0xcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a.
//
// Solidity: event Issue(uint256 amount)
func (_Token *TokenFilterer) ParseIssue(log types.Log) (*TokenIssue, error) {
event := new(TokenIssue)
if err := _Token.contract.UnpackLog(event, "Issue", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// TokenParamsIterator is returned from FilterParams and is used to iterate over the raw logs and unpacked data for Params events raised by the Token contract.
type TokenParamsIterator struct {
Event *TokenParams // 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 *TokenParamsIterator) 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(TokenParams)
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(TokenParams)
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 *TokenParamsIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *TokenParamsIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// TokenParams represents a Params event raised by the Token contract.
type TokenParams struct {
FeeBasisPoints *big.Int
MaxFee *big.Int
Raw types.Log // Blockchain specific contextual infos
}
// FilterParams is a free log retrieval operation binding the contract event 0xb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e.
//
// Solidity: event Params(uint256 feeBasisPoints, uint256 maxFee)
func (_Token *TokenFilterer) FilterParams(opts *bind.FilterOpts) (*TokenParamsIterator, error) {
logs, sub, err := _Token.contract.FilterLogs(opts, "Params")
if err != nil {
return nil, err
}
return &TokenParamsIterator{contract: _Token.contract, event: "Params", logs: logs, sub: sub}, nil
}
// WatchParams is a free log subscription operation binding the contract event 0xb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e.
//
// Solidity: event Params(uint256 feeBasisPoints, uint256 maxFee)
func (_Token *TokenFilterer) WatchParams(opts *bind.WatchOpts, sink chan<- *TokenParams) (event.Subscription, error) {
logs, sub, err := _Token.contract.WatchLogs(opts, "Params")
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(TokenParams)
if err := _Token.contract.UnpackLog(event, "Params", 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
}
// ParseParams is a log parse operation binding the contract event 0xb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e.
//
// Solidity: event Params(uint256 feeBasisPoints, uint256 maxFee)
func (_Token *TokenFilterer) ParseParams(log types.Log) (*TokenParams, error) {
event := new(TokenParams)
if err := _Token.contract.UnpackLog(event, "Params", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// TokenPauseIterator is returned from FilterPause and is used to iterate over the raw logs and unpacked data for Pause events raised by the Token contract.
type TokenPauseIterator struct {
Event *TokenPause // 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 *TokenPauseIterator) 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(TokenPause)
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(TokenPause)
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 *TokenPauseIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *TokenPauseIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// TokenPause represents a Pause event raised by the Token contract.
type TokenPause struct {
Raw types.Log // Blockchain specific contextual infos
}
// FilterPause is a free log retrieval operation binding the contract event 0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625.
//
// Solidity: event Pause()
func (_Token *TokenFilterer) FilterPause(opts *bind.FilterOpts) (*TokenPauseIterator, error) {
logs, sub, err := _Token.contract.FilterLogs(opts, "Pause")
if err != nil {
return nil, err
}
return &TokenPauseIterator{contract: _Token.contract, event: "Pause", logs: logs, sub: sub}, nil
}
// WatchPause is a free log subscription operation binding the contract event 0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625.
//
// Solidity: event Pause()
func (_Token *TokenFilterer) WatchPause(opts *bind.WatchOpts, sink chan<- *TokenPause) (event.Subscription, error) {
logs, sub, err := _Token.contract.WatchLogs(opts, "Pause")
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(TokenPause)
if err := _Token.contract.UnpackLog(event, "Pause", 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
}
// ParsePause is a log parse operation binding the contract event 0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625.
//
// Solidity: event Pause()
func (_Token *TokenFilterer) ParsePause(log types.Log) (*TokenPause, error) {
event := new(TokenPause)
if err := _Token.contract.UnpackLog(event, "Pause", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// TokenRedeemIterator is returned from FilterRedeem and is used to iterate over the raw logs and unpacked data for Redeem events raised by the Token contract.
type TokenRedeemIterator struct {
Event *TokenRedeem // 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 *TokenRedeemIterator) 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(TokenRedeem)
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(TokenRedeem)
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 *TokenRedeemIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *TokenRedeemIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// TokenRedeem represents a Redeem event raised by the Token contract.
type TokenRedeem struct {
Amount *big.Int
Raw types.Log // Blockchain specific contextual infos
}
// FilterRedeem is a free log retrieval operation binding the contract event 0x702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44.
//
// Solidity: event Redeem(uint256 amount)
func (_Token *TokenFilterer) FilterRedeem(opts *bind.FilterOpts) (*TokenRedeemIterator, error) {
logs, sub, err := _Token.contract.FilterLogs(opts, "Redeem")
if err != nil {
return nil, err
}
return &TokenRedeemIterator{contract: _Token.contract, event: "Redeem", logs: logs, sub: sub}, nil
}
// WatchRedeem is a free log subscription operation binding the contract event 0x702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44.
//
// Solidity: event Redeem(uint256 amount)
func (_Token *TokenFilterer) WatchRedeem(opts *bind.WatchOpts, sink chan<- *TokenRedeem) (event.Subscription, error) {
logs, sub, err := _Token.contract.WatchLogs(opts, "Redeem")
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(TokenRedeem)
if err := _Token.contract.UnpackLog(event, "Redeem", 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
}
// ParseRedeem is a log parse operation binding the contract event 0x702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44.
//
// Solidity: event Redeem(uint256 amount)
func (_Token *TokenFilterer) ParseRedeem(log types.Log) (*TokenRedeem, error) {
event := new(TokenRedeem)
if err := _Token.contract.UnpackLog(event, "Redeem", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// TokenRemovedBlackListIterator is returned from FilterRemovedBlackList and is used to iterate over the raw logs and unpacked data for RemovedBlackList events raised by the Token contract.
type TokenRemovedBlackListIterator struct {
Event *TokenRemovedBlackList // 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 *TokenRemovedBlackListIterator) 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(TokenRemovedBlackList)
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(TokenRemovedBlackList)
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 *TokenRemovedBlackListIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *TokenRemovedBlackListIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// TokenRemovedBlackList represents a RemovedBlackList event raised by the Token contract.
type TokenRemovedBlackList struct {
User common.Address
Raw types.Log // Blockchain specific contextual infos
}
// FilterRemovedBlackList is a free log retrieval operation binding the contract event 0xd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c.
//
// Solidity: event RemovedBlackList(address _user)
func (_Token *TokenFilterer) FilterRemovedBlackList(opts *bind.FilterOpts) (*TokenRemovedBlackListIterator, error) {
logs, sub, err := _Token.contract.FilterLogs(opts, "RemovedBlackList")
if err != nil {
return nil, err
}
return &TokenRemovedBlackListIterator{contract: _Token.contract, event: "RemovedBlackList", logs: logs, sub: sub}, nil
}
// WatchRemovedBlackList is a free log subscription operation binding the contract event 0xd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c.
//
// Solidity: event RemovedBlackList(address _user)
func (_Token *TokenFilterer) WatchRemovedBlackList(opts *bind.WatchOpts, sink chan<- *TokenRemovedBlackList) (event.Subscription, error) {
logs, sub, err := _Token.contract.WatchLogs(opts, "RemovedBlackList")
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(TokenRemovedBlackList)
if err := _Token.contract.UnpackLog(event, "RemovedBlackList", 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
}
// ParseRemovedBlackList is a log parse operation binding the contract event 0xd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c.
//
// Solidity: event RemovedBlackList(address _user)
func (_Token *TokenFilterer) ParseRemovedBlackList(log types.Log) (*TokenRemovedBlackList, error) {
event := new(TokenRemovedBlackList)
if err := _Token.contract.UnpackLog(event, "RemovedBlackList", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// TokenTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Token contract.
type TokenTransferIterator struct {
Event *TokenTransfer // 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 *TokenTransferIterator) 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(TokenTransfer)
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(TokenTransfer)
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 *TokenTransferIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *TokenTransferIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// TokenTransfer represents a Transfer event raised by the Token contract.
type TokenTransfer struct {
From common.Address
To common.Address
Value *big.Int
Raw types.Log // Blockchain specific contextual infos
}
// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
//
// Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
func (_Token *TokenFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenTransferIterator, error) {
var fromRule []interface{}
for _, fromItem := range from {
fromRule = append(fromRule, fromItem)
}
var toRule []interface{}
for _, toItem := range to {
toRule = append(toRule, toItem)
}
logs, sub, err := _Token.contract.FilterLogs(opts, "Transfer", fromRule, toRule)
if err != nil {
return nil, err
}
return &TokenTransferIterator{contract: _Token.contract, event: "Transfer", logs: logs, sub: sub}, nil
}
// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
//
// Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
func (_Token *TokenFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *TokenTransfer, from []common.Address, to []common.Address) (event.Subscription, error) {
var fromRule []interface{}
for _, fromItem := range from {
fromRule = append(fromRule, fromItem)
}
var toRule []interface{}
for _, toItem := range to {
toRule = append(toRule, toItem)
}
logs, sub, err := _Token.contract.WatchLogs(opts, "Transfer", fromRule, toRule)
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(TokenTransfer)
if err := _Token.contract.UnpackLog(event, "Transfer", 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
}
// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
//
// Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
func (_Token *TokenFilterer) ParseTransfer(log types.Log) (*TokenTransfer, error) {
event := new(TokenTransfer)
if err := _Token.contract.UnpackLog(event, "Transfer", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// TokenUnpauseIterator is returned from FilterUnpause and is used to iterate over the raw logs and unpacked data for Unpause events raised by the Token contract.
type TokenUnpauseIterator struct {
Event *TokenUnpause // 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 *TokenUnpauseIterator) 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(TokenUnpause)
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(TokenUnpause)
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 *TokenUnpauseIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *TokenUnpauseIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// TokenUnpause represents a Unpause event raised by the Token contract.
type TokenUnpause struct {
Raw types.Log // Blockchain specific contextual infos
}
// FilterUnpause is a free log retrieval operation binding the contract event 0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33.
//
// Solidity: event Unpause()
func (_Token *TokenFilterer) FilterUnpause(opts *bind.FilterOpts) (*TokenUnpauseIterator, error) {
logs, sub, err := _Token.contract.FilterLogs(opts, "Unpause")
if err != nil {
return nil, err
}
return &TokenUnpauseIterator{contract: _Token.contract, event: "Unpause", logs: logs, sub: sub}, nil
}
// WatchUnpause is a free log subscription operation binding the contract event 0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33.
//
// Solidity: event Unpause()
func (_Token *TokenFilterer) WatchUnpause(opts *bind.WatchOpts, sink chan<- *TokenUnpause) (event.Subscription, error) {
logs, sub, err := _Token.contract.WatchLogs(opts, "Unpause")
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(TokenUnpause)
if err := _Token.contract.UnpackLog(event, "Unpause", 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
}
// ParseUnpause is a log parse operation binding the contract event 0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33.
//
// Solidity: event Unpause()
func (_Token *TokenFilterer) ParseUnpause(log types.Log) (*TokenUnpause, error) {
event := new(TokenUnpause)
if err := _Token.contract.UnpackLog(event, "Unpause", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
package dao
import (
"context"
"fmt"
"pump/config"
dbModel "pump/model/db"
"time"
"github.com/ethereum/go-ethereum/ethclient"
"gorm.io/driver/postgres"
"gorm.io/gorm"
"gorm.io/gorm/logger"
"gorm.io/gorm/schema"
)
type Dao struct {
c *config.Config
db *gorm.DB
ethClient *ethclient.Client
}
func New(_c *config.Config) (dao *Dao, err error) {
dao = &Dao{
c: _c,
}
dao.ethClient, err = ethclient.Dial(_c.Chain.RPC)
if err != nil {
return
}
chainId, err := dao.ethClient.ChainID(context.Background())
if err != nil {
panic(fmt.Sprintf("failed to get l1 chain id %+v", err))
}
_c.Chain.ChainId = int(chainId.Int64())
dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d",
_c.PGSQL.Host, _c.PGSQL.User, _c.PGSQL.Password, _c.PGSQL.Database, _c.PGSQL.Port,
)
if _c.PGSQL.CertFile != "" {
dsn = fmt.Sprintf("%s sslmode=require sslrootcert=%s", dsn, _c.PGSQL.CertFile)
}
lgr := logger.Default
if _c.PGSQL.EnableLog {
lgr = logger.Default.LogMode(logger.Info)
}
dao.db, err = gorm.Open(postgres.Open(dsn), &gorm.Config{
NamingStrategy: schema.NamingStrategy{
SingularTable: true,
},
DisableForeignKeyConstraintWhenMigrating: true, // 停用外键约束
Logger: lgr,
})
if err != nil {
return
}
sqlDB, err := dao.db.DB()
if err != nil {
return
}
sqlDB.SetMaxOpenConns(_c.PGSQL.MaxConn)
sqlDB.SetMaxIdleConns(_c.PGSQL.MaxIdleConn)
sqlDB.SetConnMaxIdleTime(time.Hour)
err = dao.db.AutoMigrate(&dbModel.Height{}, &dbModel.Token{}, &dbModel.TradeHistory{})
if err != nil {
panic(err)
}
return dao, nil
}
package dao
import (
"errors"
dbModel "pump/model/db"
"strings"
"github.com/shopspring/decimal"
"gorm.io/gorm"
"gorm.io/gorm/clause"
"gorm.io/gorm/logger"
)
// GetStorageHeight 获取上次缓存的高度
func (d *Dao) GetStorageHeight(key string) (value int, err error) {
storage := new(dbModel.Height)
err = d.db.Model(storage).Where("key = ?", key).First(storage).Error
if errors.Is(err, gorm.ErrRecordNotFound) {
// 返回一个默认的起始高度
if strings.Contains(key, "l1") {
return 6202096, nil
}
return 306880, nil
}
return storage.IntValue, err
}
// SetStorageHeight 设置上次缓存的高度
func (d *Dao) SetStorageHeight(key string, intValue int) (err error) {
tx := d.db.Session(&gorm.Session{Logger: d.db.Logger.LogMode(logger.Error)})
return tx.Model(&dbModel.Height{}).Clauses(clause.OnConflict{UpdateAll: true}).Create(&dbModel.Height{
Key: key,
IntValue: intValue,
}).Error
}
func (d *Dao) CreateToken(token *dbModel.Token) (err error) {
return d.db.Clauses(clause.OnConflict{DoNothing: true}).Create(token).Error
}
func (d *Dao) UpdateToken(token string, newPrice, newMarketCap, newVolume, newVolume24H, newReserve0, newReserve1 decimal.Decimal) (err error) {
token = strings.ToLower(token)
return d.db.Model(&dbModel.Token{}).Where("token = ?", token).Updates(map[string]interface{}{
"price": newPrice,
"market_cap": newMarketCap,
"volume": newVolume,
"volume24h": newVolume24H,
"reserve0": newReserve0,
"reserve1": newReserve1,
}).Error
}
func (d *Dao) GraduateToken(token, txHash, uniV2Pair string) (err error) {
token = strings.ToLower(token)
uniV2Pair = strings.ToLower(uniV2Pair)
return d.db.Model(&dbModel.Token{}).Where("token = ?", token).Updates(map[string]interface{}{
"graduated": true,
"graduated_tx_hash": txHash,
"uniswap_v2_pair": uniV2Pair,
}).Error
}
func (d *Dao) CreateTradeHistory(tradeHistory *dbModel.TradeHistory) (err error) {
return d.db.Clauses(clause.OnConflict{DoNothing: true}).Create(tradeHistory).Error
}
package dao
import (
"context"
"math/big"
"pump/contract/bonding"
"time"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
func (d *Dao) GetBlockHeight(behindBlock ...int) (height int, err error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
n, err := d.ethClient.BlockNumber(ctx)
if len(behindBlock) > 0 {
n -= uint64(behindBlock[0])
if n < 0 {
n = 0
}
}
return int(n), err
}
func (d *Dao) GetLogs(beginHeight, endHeight int, topics, addresses []string) (logs []types.Log, err error) {
for i := 0; i < 2; i++ {
// 重试2次
logs, err = d.getLogs(beginHeight, endHeight, topics, addresses)
if err == nil {
return logs, nil
}
}
return
}
func (d *Dao) getLogs(beginHeight, endHeight int, topics []string, addresses []string) (logs []types.Log, err error) {
addrs := make([]common.Address, 0)
for _, addr := range addresses {
addrs = append(addrs, common.HexToAddress(addr))
}
q := ethereum.FilterQuery{
FromBlock: big.NewInt(int64(beginHeight)),
ToBlock: big.NewInt(int64(endHeight)),
Topics: [][]common.Hash{{}},
Addresses: addrs,
}
for _, topic := range topics {
q.Topics[0] = append(q.Topics[0], common.HexToHash(topic))
}
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
return d.ethClient.FilterLogs(ctx, q)
}
func (d *Dao) GetTokenInfo(addr string) (info struct {
Creator common.Address
Token common.Address
Pair common.Address
NftAddress common.Address
Data bonding.BondingData
Description string
Image string
Website string
Twitter string
Telegram string
Trading bool
TradingOnUniswap bool
UniswapV2Pair common.Address
}, err error) {
ca, err := bonding.NewBonding(common.HexToAddress(d.c.Chain.BondingContract), d.ethClient)
if err != nil {
return
}
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
opts := &bind.CallOpts{Context: ctx}
return ca.TokenInfo(opts, common.HexToAddress(addr))
}
services:
pump-sync:
image: caduceus/pump:latest
pull_policy: always
container_name: pump-sync
volumes:
- ./conf/pump/config.toml:/config.toml
- ./conf/pump/db.crt:/app/db.crt
- ./data/pump-sync/sync-log:/app
command:
- "/bin/sh"
- "-c"
- "/usr/bin/sync -c /config.toml"
restart:
unless-stopped
\ No newline at end of file
module pump
go 1.21.4
require (
github.com/BurntSushi/toml v1.4.0
github.com/btcsuite/btcutil v1.0.2
github.com/ethereum/go-ethereum v1.12.2
github.com/shopspring/decimal v1.4.0
github.com/sirupsen/logrus v1.9.3
golang.org/x/crypto v0.23.0
gorm.io/driver/postgres v1.5.11
gorm.io/gorm v1.25.10
)
require (
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd v0.20.1-beta // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgx/v5 v5.5.5 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
golang.org/x/exp v0.0.0-20230810033253-352e893a4cad // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
)
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8=
github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA=
github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8=
github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o=
github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88=
github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw=
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k=
github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
github.com/btcsuite/btcutil v1.0.2 h1:9iZ1Terx9fMIOtq1VrwdqfsATL9MC2l8ZrUY6YZ2uts=
github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts=
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk=
github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8=
github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk=
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE=
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs=
github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 h1:ytcWPaNPhNoGMWEhDvS3zToKcDpRsLuRolQJBVGdozk=
github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811/go.mod h1:Nb5lgvnQ2+oGlE/EyZy4+2/CxRh9KfvCXnag1vtpxVM=
github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ=
github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ=
github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI=
github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M=
github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI=
github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc=
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM=
github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4=
github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=
github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA=
github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethereum/go-ethereum v1.12.2 h1:eGHJ4ij7oyVqUQn48LBz3B7pvQ8sV0wGJiIE6gDq/6Y=
github.com/ethereum/go-ethereum v1.12.2/go.mod h1:1cRAEV+rp/xX0zraSCBnu9Py3HQ+geRMj3HdR+k0wfI=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI=
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww=
github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0=
github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ=
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw=
github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4=
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog=
github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk=
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE=
github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0=
github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw=
github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc=
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU=
github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ=
github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw=
github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A=
github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk=
github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus=
github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw=
github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag=
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A=
github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4=
github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY=
github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=
github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI=
github.com/prometheus/common v0.39.0/go.mod h1:6XBZ7lYdLCbkAVhwRsWTZn+IN5AB9F/NXd5w0BbEX0Y=
github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU=
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA=
github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4=
github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/urfave/cli/v2 v2.24.1 h1:/QYYr7g0EhwXEML8jO+8OYt5trPnLHS0p3mrgExJ5NU=
github.com/urfave/cli/v2 v2.24.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/exp v0.0.0-20230810033253-352e893a4cad h1:g0bG7Z4uG+OgH2QDODnjp6ggkk1bJDsINcuWmJN1iJU=
golang.org/x/exp v0.0.0-20230810033253-352e893a4cad/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU=
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/driver/postgres v1.5.11 h1:ubBVAfbKEUld/twyKZ0IYn9rSQh448EdelLYk9Mv314=
gorm.io/driver/postgres v1.5.11/go.mod h1:DX3GReXH+3FPWGrrgffdvCk3DQ1dwDPdmbenSkweRGI=
gorm.io/gorm v1.25.10 h1:dQpO+33KalOA+aFYGlK+EfxcI5MbO7EP2yYygwh9h+s=
gorm.io/gorm v1.25.10/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU=
rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA=
package dbModel
import (
"github.com/shopspring/decimal"
"gorm.io/gorm"
)
type Token struct {
Id int `gorm:"primaryKey"`
Creator string `gorm:"type:varchar(255);index;not null;comment:创建者"`
Token string `gorm:"type:varchar(255);index;not null;comment:token"`
NFTAddress string `gorm:"type:varchar(255);not null;comment:nft地址"`
Pair string `gorm:"type:varchar(255);not null;comment:pair"`
Ticker string `gorm:"type:varchar(255);not null;comment:token"`
Name string `gorm:"type:varchar(255);not null;comment:名称"`
Supply decimal.Decimal `gorm:"type:decimal(65,0);comment:总量"`
Description string `gorm:"type:varchar(10000);not null;comment:描述"`
Image string `gorm:"type:varchar(255);not null;comment:图片"`
Twitter string `gorm:"type:varchar(255);not null;comment:twitter"`
Website string `gorm:"type:varchar(255);not null;comment:website"`
Telegram string `gorm:"type:varchar(255);not null;comment:telegram"`
UniswapV2Pair string `gorm:"type:varchar(255);not null;comment:uniswapV2Pair"`
Graduated bool `gorm:"type:bool;not null;comment:内盘结束"`
GraduatedTxHash string `gorm:"type:varchar(255);not null;comment:内盘结束交易hash"`
Price decimal.Decimal `gorm:"type:decimal(40,18);comment:价格"`
MarketCap decimal.Decimal `gorm:"type:decimal(65,0);comment:市值"`
Volume decimal.Decimal `gorm:"type:decimal(65,0);comment:成交量"`
Volume24H decimal.Decimal `gorm:"type:decimal(65,0);column:volume24h;comment:24小时成交量"`
Reserve0 decimal.Decimal `gorm:"type:decimal(65,0);comment:储备0"`
Reserve1 decimal.Decimal `gorm:"type:decimal(65,0);comment:储备1"`
TxHash string `gorm:"type:varchar(255);uniqueIndex;comment:tx hash"`
BlockNumber int `gorm:"type:int;comment:区块高度"`
BlockTime int `gorm:"type:int;index;comment:区块时间"`
gorm.Model
}
func (*Token) TableName() string {
return "public.token"
}
type TradeHistory struct {
Id int `gorm:"primaryKey"`
FromAddress string `gorm:"type:varchar(255);index;not null;comment:用户地址"`
Token string `gorm:"type:varchar(255);index;not null;comment:token"`
AmountIn decimal.Decimal `gorm:"type:decimal(40,18);comment:转入数量"`
AmountOut decimal.Decimal `gorm:"type:decimal(40,18);comment:转出数量"`
Price decimal.Decimal `gorm:"type:decimal(40,18);comment:价格"`
IsBuy bool `gorm:"type:bool;not null;comment:是否是买入"`
TxHash string `gorm:"type:varchar(255);not null;uniqueIndex:uidx_hash_idx;comment:tx hash"`
LogIndex int `gorm:"type:int;not null;uniqueIndex:uidx_hash_idx;comment:log index"`
BlockTime int `gorm:"type:int;index;comment:区块时间"`
BlockNumber int `gorm:"type:int;comment:区块高度"`
gorm.Model
}
func (*TradeHistory) TableName() string {
return "public.trade_history"
}
type Height struct {
Key string `gorm:"primaryKey"`
IntValue int `gorm:"type:int;not null"` // 配置value
}
func (*Height) TableName() string {
return "public.height"
}
# pump backend
\ No newline at end of file
package util
func BlockToTimestamp(block int) int {
return 1686789347 + block*2
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment