github.com/0xPolygon/supernets2-node@v0.0.0-20230711153321-2fe574524eaa/test/contracts/bin/Counter/Counter.go (about) 1 // Code generated - DO NOT EDIT. 2 // This file is a generated binding and any manual changes will be lost. 3 4 package Counter 5 6 import ( 7 "errors" 8 "math/big" 9 "strings" 10 11 ethereum "github.com/ethereum/go-ethereum" 12 "github.com/ethereum/go-ethereum/accounts/abi" 13 "github.com/ethereum/go-ethereum/accounts/abi/bind" 14 "github.com/ethereum/go-ethereum/common" 15 "github.com/ethereum/go-ethereum/core/types" 16 "github.com/ethereum/go-ethereum/event" 17 ) 18 19 // Reference imports to suppress errors if they are not otherwise used. 20 var ( 21 _ = errors.New 22 _ = big.NewInt 23 _ = strings.NewReader 24 _ = ethereum.NotFound 25 _ = bind.Bind 26 _ = common.Big1 27 _ = types.BloomLookup 28 _ = event.NewSubscription 29 _ = abi.ConvertType 30 ) 31 32 // CounterMetaData contains all meta data concerning the Counter contract. 33 var CounterMetaData = &bind.MetaData{ 34 ABI: "[{\"inputs\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"increment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", 35 Bin: "0x608060405234801561001057600080fd5b5060dc8061001f6000396000f3fe6080604052348015600f57600080fd5b5060043610603c5760003560e01c806306661abd146041578063a87d942c14605b578063d09de08a146062575b600080fd5b604960005481565b60405190815260200160405180910390f35b6000546049565b6068606a565b005b6001600080828254607a91906081565b9091555050565b6000821982111560a157634e487b7160e01b600052601160045260246000fd5b50019056fea26469706673582212203dde2a11f13de2ac0ba7c486c16ed13e810a9bfd6907be0249306d2273373bd664736f6c634300080c0033", 36 } 37 38 // CounterABI is the input ABI used to generate the binding from. 39 // Deprecated: Use CounterMetaData.ABI instead. 40 var CounterABI = CounterMetaData.ABI 41 42 // CounterBin is the compiled bytecode used for deploying new contracts. 43 // Deprecated: Use CounterMetaData.Bin instead. 44 var CounterBin = CounterMetaData.Bin 45 46 // DeployCounter deploys a new Ethereum contract, binding an instance of Counter to it. 47 func DeployCounter(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Counter, error) { 48 parsed, err := CounterMetaData.GetAbi() 49 if err != nil { 50 return common.Address{}, nil, nil, err 51 } 52 if parsed == nil { 53 return common.Address{}, nil, nil, errors.New("GetABI returned nil") 54 } 55 56 address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(CounterBin), backend) 57 if err != nil { 58 return common.Address{}, nil, nil, err 59 } 60 return address, tx, &Counter{CounterCaller: CounterCaller{contract: contract}, CounterTransactor: CounterTransactor{contract: contract}, CounterFilterer: CounterFilterer{contract: contract}}, nil 61 } 62 63 // Counter is an auto generated Go binding around an Ethereum contract. 64 type Counter struct { 65 CounterCaller // Read-only binding to the contract 66 CounterTransactor // Write-only binding to the contract 67 CounterFilterer // Log filterer for contract events 68 } 69 70 // CounterCaller is an auto generated read-only Go binding around an Ethereum contract. 71 type CounterCaller struct { 72 contract *bind.BoundContract // Generic contract wrapper for the low level calls 73 } 74 75 // CounterTransactor is an auto generated write-only Go binding around an Ethereum contract. 76 type CounterTransactor struct { 77 contract *bind.BoundContract // Generic contract wrapper for the low level calls 78 } 79 80 // CounterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. 81 type CounterFilterer struct { 82 contract *bind.BoundContract // Generic contract wrapper for the low level calls 83 } 84 85 // CounterSession is an auto generated Go binding around an Ethereum contract, 86 // with pre-set call and transact options. 87 type CounterSession struct { 88 Contract *Counter // Generic contract binding to set the session for 89 CallOpts bind.CallOpts // Call options to use throughout this session 90 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 91 } 92 93 // CounterCallerSession is an auto generated read-only Go binding around an Ethereum contract, 94 // with pre-set call options. 95 type CounterCallerSession struct { 96 Contract *CounterCaller // Generic contract caller binding to set the session for 97 CallOpts bind.CallOpts // Call options to use throughout this session 98 } 99 100 // CounterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 101 // with pre-set transact options. 102 type CounterTransactorSession struct { 103 Contract *CounterTransactor // Generic contract transactor binding to set the session for 104 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 105 } 106 107 // CounterRaw is an auto generated low-level Go binding around an Ethereum contract. 108 type CounterRaw struct { 109 Contract *Counter // Generic contract binding to access the raw methods on 110 } 111 112 // CounterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 113 type CounterCallerRaw struct { 114 Contract *CounterCaller // Generic read-only contract binding to access the raw methods on 115 } 116 117 // CounterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 118 type CounterTransactorRaw struct { 119 Contract *CounterTransactor // Generic write-only contract binding to access the raw methods on 120 } 121 122 // NewCounter creates a new instance of Counter, bound to a specific deployed contract. 123 func NewCounter(address common.Address, backend bind.ContractBackend) (*Counter, error) { 124 contract, err := bindCounter(address, backend, backend, backend) 125 if err != nil { 126 return nil, err 127 } 128 return &Counter{CounterCaller: CounterCaller{contract: contract}, CounterTransactor: CounterTransactor{contract: contract}, CounterFilterer: CounterFilterer{contract: contract}}, nil 129 } 130 131 // NewCounterCaller creates a new read-only instance of Counter, bound to a specific deployed contract. 132 func NewCounterCaller(address common.Address, caller bind.ContractCaller) (*CounterCaller, error) { 133 contract, err := bindCounter(address, caller, nil, nil) 134 if err != nil { 135 return nil, err 136 } 137 return &CounterCaller{contract: contract}, nil 138 } 139 140 // NewCounterTransactor creates a new write-only instance of Counter, bound to a specific deployed contract. 141 func NewCounterTransactor(address common.Address, transactor bind.ContractTransactor) (*CounterTransactor, error) { 142 contract, err := bindCounter(address, nil, transactor, nil) 143 if err != nil { 144 return nil, err 145 } 146 return &CounterTransactor{contract: contract}, nil 147 } 148 149 // NewCounterFilterer creates a new log filterer instance of Counter, bound to a specific deployed contract. 150 func NewCounterFilterer(address common.Address, filterer bind.ContractFilterer) (*CounterFilterer, error) { 151 contract, err := bindCounter(address, nil, nil, filterer) 152 if err != nil { 153 return nil, err 154 } 155 return &CounterFilterer{contract: contract}, nil 156 } 157 158 // bindCounter binds a generic wrapper to an already deployed contract. 159 func bindCounter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 160 parsed, err := CounterMetaData.GetAbi() 161 if err != nil { 162 return nil, err 163 } 164 return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil 165 } 166 167 // Call invokes the (constant) contract method with params as input values and 168 // sets the output to result. The result type might be a single field for simple 169 // returns, a slice of interfaces for anonymous returns and a struct for named 170 // returns. 171 func (_Counter *CounterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 172 return _Counter.Contract.CounterCaller.contract.Call(opts, result, method, params...) 173 } 174 175 // Transfer initiates a plain transaction to move funds to the contract, calling 176 // its default method if one is available. 177 func (_Counter *CounterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 178 return _Counter.Contract.CounterTransactor.contract.Transfer(opts) 179 } 180 181 // Transact invokes the (paid) contract method with params as input values. 182 func (_Counter *CounterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 183 return _Counter.Contract.CounterTransactor.contract.Transact(opts, method, params...) 184 } 185 186 // Call invokes the (constant) contract method with params as input values and 187 // sets the output to result. The result type might be a single field for simple 188 // returns, a slice of interfaces for anonymous returns and a struct for named 189 // returns. 190 func (_Counter *CounterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 191 return _Counter.Contract.contract.Call(opts, result, method, params...) 192 } 193 194 // Transfer initiates a plain transaction to move funds to the contract, calling 195 // its default method if one is available. 196 func (_Counter *CounterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 197 return _Counter.Contract.contract.Transfer(opts) 198 } 199 200 // Transact invokes the (paid) contract method with params as input values. 201 func (_Counter *CounterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 202 return _Counter.Contract.contract.Transact(opts, method, params...) 203 } 204 205 // Count is a free data retrieval call binding the contract method 0x06661abd. 206 // 207 // Solidity: function count() view returns(uint256) 208 func (_Counter *CounterCaller) Count(opts *bind.CallOpts) (*big.Int, error) { 209 var out []interface{} 210 err := _Counter.contract.Call(opts, &out, "count") 211 212 if err != nil { 213 return *new(*big.Int), err 214 } 215 216 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 217 218 return out0, err 219 220 } 221 222 // Count is a free data retrieval call binding the contract method 0x06661abd. 223 // 224 // Solidity: function count() view returns(uint256) 225 func (_Counter *CounterSession) Count() (*big.Int, error) { 226 return _Counter.Contract.Count(&_Counter.CallOpts) 227 } 228 229 // Count is a free data retrieval call binding the contract method 0x06661abd. 230 // 231 // Solidity: function count() view returns(uint256) 232 func (_Counter *CounterCallerSession) Count() (*big.Int, error) { 233 return _Counter.Contract.Count(&_Counter.CallOpts) 234 } 235 236 // GetCount is a free data retrieval call binding the contract method 0xa87d942c. 237 // 238 // Solidity: function getCount() view returns(uint256) 239 func (_Counter *CounterCaller) GetCount(opts *bind.CallOpts) (*big.Int, error) { 240 var out []interface{} 241 err := _Counter.contract.Call(opts, &out, "getCount") 242 243 if err != nil { 244 return *new(*big.Int), err 245 } 246 247 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 248 249 return out0, err 250 251 } 252 253 // GetCount is a free data retrieval call binding the contract method 0xa87d942c. 254 // 255 // Solidity: function getCount() view returns(uint256) 256 func (_Counter *CounterSession) GetCount() (*big.Int, error) { 257 return _Counter.Contract.GetCount(&_Counter.CallOpts) 258 } 259 260 // GetCount is a free data retrieval call binding the contract method 0xa87d942c. 261 // 262 // Solidity: function getCount() view returns(uint256) 263 func (_Counter *CounterCallerSession) GetCount() (*big.Int, error) { 264 return _Counter.Contract.GetCount(&_Counter.CallOpts) 265 } 266 267 // Increment is a paid mutator transaction binding the contract method 0xd09de08a. 268 // 269 // Solidity: function increment() returns() 270 func (_Counter *CounterTransactor) Increment(opts *bind.TransactOpts) (*types.Transaction, error) { 271 return _Counter.contract.Transact(opts, "increment") 272 } 273 274 // Increment is a paid mutator transaction binding the contract method 0xd09de08a. 275 // 276 // Solidity: function increment() returns() 277 func (_Counter *CounterSession) Increment() (*types.Transaction, error) { 278 return _Counter.Contract.Increment(&_Counter.TransactOpts) 279 } 280 281 // Increment is a paid mutator transaction binding the contract method 0xd09de08a. 282 // 283 // Solidity: function increment() returns() 284 func (_Counter *CounterTransactorSession) Increment() (*types.Transaction, error) { 285 return _Counter.Contract.Increment(&_Counter.TransactOpts) 286 }