2023-08-21 19:10:32 +00:00
|
|
|
// Code generated - DO NOT EDIT.
|
|
|
|
// This file is a generated binding and any manual changes will be lost.
|
|
|
|
|
|
|
|
package contracts
|
|
|
|
|
|
|
|
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
|
|
|
|
)
|
|
|
|
|
|
|
|
// PoseidonHasherMetaData contains all meta data concerning the PoseidonHasher contract.
|
|
|
|
var PoseidonHasherMetaData = &bind.MetaData{
|
2023-08-30 22:00:14 +00:00
|
|
|
ABI: "[{\"inputs\":[],\"name\":\"Q\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"input\",\"type\":\"uint256\"}],\"name\":\"hash\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"result\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]",
|
|
|
|
Bin: "0x608060405234801561001057600080fd5b50613e58806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063b189fd4c1461003b578063e493ef8c1461006b575b600080fd5b61005560048036038101906100509190613dcb565b610089565b6040516100629190613e07565b60405180910390f35b61007361009b565b6040516100809190613e07565b60405180910390f35b6000610094826100bf565b9050919050565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000181565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000017f09c46e9ec68e9bd4fe1faaba294cba38a71aa177534cdd1b6c7dc0dbd0abd7a77f0c0356530896eec42a97ed937f3135cfc5142b3ae405b8343c1d83ffa604cb81840182828309838385838409099250838283099050838285838409099150837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1e28a1d935698ad1142e51182bb54cf4a00ea5aabd6268bd317ea977cc154a30830192507f27af2d831a9d2748080965db30e298e40e5757c3e008db964cf9e2b12b91251f82019150838384099050838385838409099250838283099050838285838409099150837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f1e6f11ce60fc8f513a6a3cfe16ae175a41291462f214cd0879aaf43545b74e03830192507f2a67384d3bbd5e438541819cb681f0be04462ed14c3613d8f719206268d142d382019150838384099050838385838409099250838283099050838285838409099150837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0b66fdf356093a611609f8e12fbfecf0b985e381f025188936408f5d5c9f45d0830192507f012ee3ec1e78d470830c61093c2ade370b26c83cc5cebeeddaa6852dbdb09e2182019150838384099050838385838409099250838283099050838285838409099150837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f0252ba5f6760bfbdfd88f67f8175e3fd6cd1c431b099b6bb2d108e7b445bb1b9830192507f179474cceca5ff676c6bec3cef54296354391a8935ff71d6ef5aeaad7ca932f182019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f2c24261379a51bfa9228ff4a503fd4ed9c1f974a264969b37e1a2589bbed2b91830192507f1cc1d7b62692e63eac2f288bd0695b43c2f63f5001fc0fc553e66c0551801b0582019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f255059301aada98bb2ed55f852979e9600784dbf17fbacd05d9eff5fd9c91b56830192507f28437be3ac1cb2e479e1f5c0eccd32b3aea24234970a8193b11c29ce7e59efd982019150838384099050838385838409099250837f2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e88309847f066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad58509019050837f1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c88309847f0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff985090191508092507f28216a442f2e1f711ca4fa6b53766eb118548da8fb4f78d4338762c37f5f2043830192507f
|
2023-08-21 19:10:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// PoseidonHasherABI is the input ABI used to generate the binding from.
|
|
|
|
// Deprecated: Use PoseidonHasherMetaData.ABI instead.
|
|
|
|
var PoseidonHasherABI = PoseidonHasherMetaData.ABI
|
|
|
|
|
|
|
|
// PoseidonHasherBin is the compiled bytecode used for deploying new contracts.
|
|
|
|
// Deprecated: Use PoseidonHasherMetaData.Bin instead.
|
|
|
|
var PoseidonHasherBin = PoseidonHasherMetaData.Bin
|
|
|
|
|
|
|
|
// DeployPoseidonHasher deploys a new Ethereum contract, binding an instance of PoseidonHasher to it.
|
|
|
|
func DeployPoseidonHasher(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *PoseidonHasher, error) {
|
|
|
|
parsed, err := PoseidonHasherMetaData.GetAbi()
|
|
|
|
if err != nil {
|
|
|
|
return common.Address{}, nil, nil, err
|
|
|
|
}
|
|
|
|
if parsed == nil {
|
|
|
|
return common.Address{}, nil, nil, errors.New("GetABI returned nil")
|
|
|
|
}
|
|
|
|
|
|
|
|
address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(PoseidonHasherBin), backend)
|
|
|
|
if err != nil {
|
|
|
|
return common.Address{}, nil, nil, err
|
|
|
|
}
|
|
|
|
return address, tx, &PoseidonHasher{PoseidonHasherCaller: PoseidonHasherCaller{contract: contract}, PoseidonHasherTransactor: PoseidonHasherTransactor{contract: contract}, PoseidonHasherFilterer: PoseidonHasherFilterer{contract: contract}}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// PoseidonHasher is an auto generated Go binding around an Ethereum contract.
|
|
|
|
type PoseidonHasher struct {
|
|
|
|
PoseidonHasherCaller // Read-only binding to the contract
|
|
|
|
PoseidonHasherTransactor // Write-only binding to the contract
|
|
|
|
PoseidonHasherFilterer // Log filterer for contract events
|
|
|
|
}
|
|
|
|
|
|
|
|
// PoseidonHasherCaller is an auto generated read-only Go binding around an Ethereum contract.
|
|
|
|
type PoseidonHasherCaller struct {
|
|
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
|
|
}
|
|
|
|
|
|
|
|
// PoseidonHasherTransactor is an auto generated write-only Go binding around an Ethereum contract.
|
|
|
|
type PoseidonHasherTransactor struct {
|
|
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
|
|
}
|
|
|
|
|
|
|
|
// PoseidonHasherFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
|
|
|
type PoseidonHasherFilterer struct {
|
|
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
|
|
}
|
|
|
|
|
|
|
|
// PoseidonHasherSession is an auto generated Go binding around an Ethereum contract,
|
|
|
|
// with pre-set call and transact options.
|
|
|
|
type PoseidonHasherSession struct {
|
|
|
|
Contract *PoseidonHasher // 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
|
|
|
|
}
|
|
|
|
|
|
|
|
// PoseidonHasherCallerSession is an auto generated read-only Go binding around an Ethereum contract,
|
|
|
|
// with pre-set call options.
|
|
|
|
type PoseidonHasherCallerSession struct {
|
|
|
|
Contract *PoseidonHasherCaller // Generic contract caller binding to set the session for
|
|
|
|
CallOpts bind.CallOpts // Call options to use throughout this session
|
|
|
|
}
|
|
|
|
|
|
|
|
// PoseidonHasherTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
|
|
|
|
// with pre-set transact options.
|
|
|
|
type PoseidonHasherTransactorSession struct {
|
|
|
|
Contract *PoseidonHasherTransactor // Generic contract transactor binding to set the session for
|
|
|
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
|
|
|
}
|
|
|
|
|
|
|
|
// PoseidonHasherRaw is an auto generated low-level Go binding around an Ethereum contract.
|
|
|
|
type PoseidonHasherRaw struct {
|
|
|
|
Contract *PoseidonHasher // Generic contract binding to access the raw methods on
|
|
|
|
}
|
|
|
|
|
|
|
|
// PoseidonHasherCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
|
|
|
|
type PoseidonHasherCallerRaw struct {
|
|
|
|
Contract *PoseidonHasherCaller // Generic read-only contract binding to access the raw methods on
|
|
|
|
}
|
|
|
|
|
|
|
|
// PoseidonHasherTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
|
|
|
|
type PoseidonHasherTransactorRaw struct {
|
|
|
|
Contract *PoseidonHasherTransactor // Generic write-only contract binding to access the raw methods on
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewPoseidonHasher creates a new instance of PoseidonHasher, bound to a specific deployed contract.
|
|
|
|
func NewPoseidonHasher(address common.Address, backend bind.ContractBackend) (*PoseidonHasher, error) {
|
|
|
|
contract, err := bindPoseidonHasher(address, backend, backend, backend)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return &PoseidonHasher{PoseidonHasherCaller: PoseidonHasherCaller{contract: contract}, PoseidonHasherTransactor: PoseidonHasherTransactor{contract: contract}, PoseidonHasherFilterer: PoseidonHasherFilterer{contract: contract}}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewPoseidonHasherCaller creates a new read-only instance of PoseidonHasher, bound to a specific deployed contract.
|
|
|
|
func NewPoseidonHasherCaller(address common.Address, caller bind.ContractCaller) (*PoseidonHasherCaller, error) {
|
|
|
|
contract, err := bindPoseidonHasher(address, caller, nil, nil)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return &PoseidonHasherCaller{contract: contract}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewPoseidonHasherTransactor creates a new write-only instance of PoseidonHasher, bound to a specific deployed contract.
|
|
|
|
func NewPoseidonHasherTransactor(address common.Address, transactor bind.ContractTransactor) (*PoseidonHasherTransactor, error) {
|
|
|
|
contract, err := bindPoseidonHasher(address, nil, transactor, nil)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return &PoseidonHasherTransactor{contract: contract}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewPoseidonHasherFilterer creates a new log filterer instance of PoseidonHasher, bound to a specific deployed contract.
|
|
|
|
func NewPoseidonHasherFilterer(address common.Address, filterer bind.ContractFilterer) (*PoseidonHasherFilterer, error) {
|
|
|
|
contract, err := bindPoseidonHasher(address, nil, nil, filterer)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return &PoseidonHasherFilterer{contract: contract}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// bindPoseidonHasher binds a generic wrapper to an already deployed contract.
|
|
|
|
func bindPoseidonHasher(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
|
|
|
|
parsed, err := PoseidonHasherMetaData.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 (_PoseidonHasher *PoseidonHasherRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
|
|
|
return _PoseidonHasher.Contract.PoseidonHasherCaller.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 (_PoseidonHasher *PoseidonHasherRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
|
|
return _PoseidonHasher.Contract.PoseidonHasherTransactor.contract.Transfer(opts)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Transact invokes the (paid) contract method with params as input values.
|
|
|
|
func (_PoseidonHasher *PoseidonHasherRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
|
|
|
return _PoseidonHasher.Contract.PoseidonHasherTransactor.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 (_PoseidonHasher *PoseidonHasherCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
|
|
|
return _PoseidonHasher.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 (_PoseidonHasher *PoseidonHasherTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
|
|
return _PoseidonHasher.Contract.contract.Transfer(opts)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Transact invokes the (paid) contract method with params as input values.
|
|
|
|
func (_PoseidonHasher *PoseidonHasherTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
|
|
|
return _PoseidonHasher.Contract.contract.Transact(opts, method, params...)
|
|
|
|
}
|
|
|
|
|
2023-08-30 22:00:14 +00:00
|
|
|
// Q is a free data retrieval call binding the contract method 0xe493ef8c.
|
|
|
|
//
|
|
|
|
// Solidity: function Q() view returns(uint256)
|
|
|
|
func (_PoseidonHasher *PoseidonHasherCaller) Q(opts *bind.CallOpts) (*big.Int, error) {
|
|
|
|
var out []interface{}
|
|
|
|
err := _PoseidonHasher.contract.Call(opts, &out, "Q")
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return *new(*big.Int), err
|
|
|
|
}
|
|
|
|
|
|
|
|
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
|
|
|
|
|
|
|
return out0, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Q is a free data retrieval call binding the contract method 0xe493ef8c.
|
|
|
|
//
|
|
|
|
// Solidity: function Q() view returns(uint256)
|
|
|
|
func (_PoseidonHasher *PoseidonHasherSession) Q() (*big.Int, error) {
|
|
|
|
return _PoseidonHasher.Contract.Q(&_PoseidonHasher.CallOpts)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Q is a free data retrieval call binding the contract method 0xe493ef8c.
|
|
|
|
//
|
|
|
|
// Solidity: function Q() view returns(uint256)
|
|
|
|
func (_PoseidonHasher *PoseidonHasherCallerSession) Q() (*big.Int, error) {
|
|
|
|
return _PoseidonHasher.Contract.Q(&_PoseidonHasher.CallOpts)
|
|
|
|
}
|
|
|
|
|
2023-08-21 19:10:32 +00:00
|
|
|
// Hash is a free data retrieval call binding the contract method 0xb189fd4c.
|
|
|
|
//
|
|
|
|
// Solidity: function hash(uint256 input) pure returns(uint256 result)
|
|
|
|
func (_PoseidonHasher *PoseidonHasherCaller) Hash(opts *bind.CallOpts, input *big.Int) (*big.Int, error) {
|
|
|
|
var out []interface{}
|
|
|
|
err := _PoseidonHasher.contract.Call(opts, &out, "hash", input)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return *new(*big.Int), err
|
|
|
|
}
|
|
|
|
|
|
|
|
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
|
|
|
|
|
|
|
return out0, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hash is a free data retrieval call binding the contract method 0xb189fd4c.
|
|
|
|
//
|
|
|
|
// Solidity: function hash(uint256 input) pure returns(uint256 result)
|
|
|
|
func (_PoseidonHasher *PoseidonHasherSession) Hash(input *big.Int) (*big.Int, error) {
|
|
|
|
return _PoseidonHasher.Contract.Hash(&_PoseidonHasher.CallOpts, input)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hash is a free data retrieval call binding the contract method 0xb189fd4c.
|
|
|
|
//
|
|
|
|
// Solidity: function hash(uint256 input) pure returns(uint256 result)
|
|
|
|
func (_PoseidonHasher *PoseidonHasherCallerSession) Hash(input *big.Int) (*big.Int, error) {
|
|
|
|
return _PoseidonHasher.Contract.Hash(&_PoseidonHasher.CallOpts, input)
|
|
|
|
}
|