Fantom-foundation/go-lachesis

View on GitHub
gossip/sfcproxy/contract.go

Summary

Maintainability
D
2 days
Test Coverage
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.

package sfcproxy

import (
    "math/big"
    "strings"

    ethereum "github.com/ethereum/go-ethereum"
    "github.com/ethereum/go-ethereum/accounts/abi"
    "github.com/ethereum/go-ethereum/accounts/abi/bind"
    "github.com/ethereum/go-ethereum/common"
    "github.com/ethereum/go-ethereum/core/types"
    "github.com/ethereum/go-ethereum/event"
)

// Reference imports to suppress errors if they are not otherwise used.
var (
    _ = big.NewInt
    _ = strings.NewReader
    _ = ethereum.NotFound
    _ = bind.Bind
    _ = common.Big1
    _ = types.BloomLookup
    _ = event.NewSubscription
)

// ContractABI is the input ABI used to generate the binding from.
const ContractABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"constant\":true,\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"}]"

// ContractBin is the compiled bytecode used for deploying new contracts.
var ContractBin = "0x608060405234801561001057600080fd5b5061057e806100206000396000f3fe60806040526004361061005a5760003560e01c80635c60da1b116100435780635c60da1b146101175780638f28397014610148578063f851a4401461017b5761005a565b80633659cfe6146100645780634f1ef28614610097575b610062610190565b005b34801561007057600080fd5b506100626004803603602081101561008757600080fd5b50356001600160a01b03166101aa565b610062600480360360408110156100ad57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d857600080fd5b8201836020820111156100ea57600080fd5b8035906020019184600183028401116401000000008311171561010c57600080fd5b5090925090506101e4565b34801561012357600080fd5b5061012c610291565b604080516001600160a01b039092168252519081900360200190f35b34801561015457600080fd5b506100626004803603602081101561016b57600080fd5b50356001600160a01b03166102a0565b34801561018757600080fd5b5061012c610374565b6101986101a8565b6101a86101a361037e565b6103a3565b565b6101b26103c7565b6001600160a01b0316336001600160a01b031614156101d9576101d4816103ec565b6101e1565b6101e1610190565b50565b6101ec6103c7565b6001600160a01b0316336001600160a01b031614156102845761020e836103ec565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026b576040519150601f19603f3d011682016040523d82523d6000602084013e610270565b606091505b505090508061027e57600080fd5b5061028c565b61028c610190565b505050565b600061029b61037e565b905090565b6102a86103c7565b6001600160a01b0316336001600160a01b031614156101d9576001600160a01b038116610320576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806104d96036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103496103c7565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d48161042c565b600061029b6103c7565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e8080156103c2573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6103f581610450565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b610459816104d2565b6104ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b81526020018061050f603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b3b15159056fe43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a265627a7a72315820dace148a559a974e5da16faa61fb5f3e684aaf2b3a130948c21b43a71fbd87f664736f6c634300050c0032"

// DeployContract deploys a new Ethereum contract, binding an instance of Contract to it.
func DeployContract(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Contract, error) {
    parsed, err := abi.JSON(strings.NewReader(ContractABI))
    if err != nil {
        return common.Address{}, nil, nil, err
    }

    address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ContractBin), backend)
    if err != nil {
        return common.Address{}, nil, nil, err
    }
    return address, tx, &Contract{ContractCaller: ContractCaller{contract: contract}, ContractTransactor: ContractTransactor{contract: contract}, ContractFilterer: ContractFilterer{contract: contract}}, nil
}

// Contract is an auto generated Go binding around an Ethereum contract.
type Contract struct {
    ContractCaller     // Read-only binding to the contract
    ContractTransactor // Write-only binding to the contract
    ContractFilterer   // Log filterer for contract events
}

// ContractCaller is an auto generated read-only Go binding around an Ethereum contract.
type ContractCaller struct {
    contract *bind.BoundContract // Generic contract wrapper for the low level calls
}

// ContractTransactor is an auto generated write-only Go binding around an Ethereum contract.
type ContractTransactor struct {
    contract *bind.BoundContract // Generic contract wrapper for the low level calls
}

// ContractFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
type ContractFilterer struct {
    contract *bind.BoundContract // Generic contract wrapper for the low level calls
}

// ContractSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type ContractSession struct {
    Contract     *Contract         // 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
}

// ContractCallerSession is an auto generated read-only Go binding around an Ethereum contract,
// with pre-set call options.
type ContractCallerSession struct {
    Contract *ContractCaller // Generic contract caller binding to set the session for
    CallOpts bind.CallOpts   // Call options to use throughout this session
}

// ContractTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
// with pre-set transact options.
type ContractTransactorSession struct {
    Contract     *ContractTransactor // Generic contract transactor binding to set the session for
    TransactOpts bind.TransactOpts   // Transaction auth options to use throughout this session
}

// ContractRaw is an auto generated low-level Go binding around an Ethereum contract.
type ContractRaw struct {
    Contract *Contract // Generic contract binding to access the raw methods on
}

// ContractCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
type ContractCallerRaw struct {
    Contract *ContractCaller // Generic read-only contract binding to access the raw methods on
}

// ContractTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
type ContractTransactorRaw struct {
    Contract *ContractTransactor // Generic write-only contract binding to access the raw methods on
}

// NewContract creates a new instance of Contract, bound to a specific deployed contract.
func NewContract(address common.Address, backend bind.ContractBackend) (*Contract, error) {
    contract, err := bindContract(address, backend, backend, backend)
    if err != nil {
        return nil, err
    }
    return &Contract{ContractCaller: ContractCaller{contract: contract}, ContractTransactor: ContractTransactor{contract: contract}, ContractFilterer: ContractFilterer{contract: contract}}, nil
}

// NewContractCaller creates a new read-only instance of Contract, bound to a specific deployed contract.
func NewContractCaller(address common.Address, caller bind.ContractCaller) (*ContractCaller, error) {
    contract, err := bindContract(address, caller, nil, nil)
    if err != nil {
        return nil, err
    }
    return &ContractCaller{contract: contract}, nil
}

// NewContractTransactor creates a new write-only instance of Contract, bound to a specific deployed contract.
func NewContractTransactor(address common.Address, transactor bind.ContractTransactor) (*ContractTransactor, error) {
    contract, err := bindContract(address, nil, transactor, nil)
    if err != nil {
        return nil, err
    }
    return &ContractTransactor{contract: contract}, nil
}

// NewContractFilterer creates a new log filterer instance of Contract, bound to a specific deployed contract.
func NewContractFilterer(address common.Address, filterer bind.ContractFilterer) (*ContractFilterer, error) {
    contract, err := bindContract(address, nil, nil, filterer)
    if err != nil {
        return nil, err
    }
    return &ContractFilterer{contract: contract}, nil
}

// bindContract binds a generic wrapper to an already deployed contract.
func bindContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
    parsed, err := abi.JSON(strings.NewReader(ContractABI))
    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 (_Contract *ContractRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
    return _Contract.Contract.ContractCaller.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 (_Contract *ContractRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
    return _Contract.Contract.ContractTransactor.contract.Transfer(opts)
}

// Transact invokes the (paid) contract method with params as input values.
func (_Contract *ContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
    return _Contract.Contract.ContractTransactor.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 (_Contract *ContractCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
    return _Contract.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 (_Contract *ContractTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
    return _Contract.Contract.contract.Transfer(opts)
}

// Transact invokes the (paid) contract method with params as input values.
func (_Contract *ContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
    return _Contract.Contract.contract.Transact(opts, method, params...)
}

// Admin is a free data retrieval call binding the contract method 0xf851a440.
//
// Solidity: function admin() view returns(address)
func (_Contract *ContractCaller) Admin(opts *bind.CallOpts) (common.Address, error) {
    var (
        ret0 = new(common.Address)
    )
    out := ret0
    err := _Contract.contract.Call(opts, out, "admin")
    return *ret0, err
}

// Admin is a free data retrieval call binding the contract method 0xf851a440.
//
// Solidity: function admin() view returns(address)
func (_Contract *ContractSession) Admin() (common.Address, error) {
    return _Contract.Contract.Admin(&_Contract.CallOpts)
}

// Admin is a free data retrieval call binding the contract method 0xf851a440.
//
// Solidity: function admin() view returns(address)
func (_Contract *ContractCallerSession) Admin() (common.Address, error) {
    return _Contract.Contract.Admin(&_Contract.CallOpts)
}

// Implementation is a free data retrieval call binding the contract method 0x5c60da1b.
//
// Solidity: function implementation() view returns(address)
func (_Contract *ContractCaller) Implementation(opts *bind.CallOpts) (common.Address, error) {
    var (
        ret0 = new(common.Address)
    )
    out := ret0
    err := _Contract.contract.Call(opts, out, "implementation")
    return *ret0, err
}

// Implementation is a free data retrieval call binding the contract method 0x5c60da1b.
//
// Solidity: function implementation() view returns(address)
func (_Contract *ContractSession) Implementation() (common.Address, error) {
    return _Contract.Contract.Implementation(&_Contract.CallOpts)
}

// Implementation is a free data retrieval call binding the contract method 0x5c60da1b.
//
// Solidity: function implementation() view returns(address)
func (_Contract *ContractCallerSession) Implementation() (common.Address, error) {
    return _Contract.Contract.Implementation(&_Contract.CallOpts)
}

// ChangeAdmin is a paid mutator transaction binding the contract method 0x8f283970.
//
// Solidity: function changeAdmin(address newAdmin) returns()
func (_Contract *ContractTransactor) ChangeAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) {
    return _Contract.contract.Transact(opts, "changeAdmin", newAdmin)
}

// ChangeAdmin is a paid mutator transaction binding the contract method 0x8f283970.
//
// Solidity: function changeAdmin(address newAdmin) returns()
func (_Contract *ContractSession) ChangeAdmin(newAdmin common.Address) (*types.Transaction, error) {
    return _Contract.Contract.ChangeAdmin(&_Contract.TransactOpts, newAdmin)
}

// ChangeAdmin is a paid mutator transaction binding the contract method 0x8f283970.
//
// Solidity: function changeAdmin(address newAdmin) returns()
func (_Contract *ContractTransactorSession) ChangeAdmin(newAdmin common.Address) (*types.Transaction, error) {
    return _Contract.Contract.ChangeAdmin(&_Contract.TransactOpts, newAdmin)
}

// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6.
//
// Solidity: function upgradeTo(address newImplementation) returns()
func (_Contract *ContractTransactor) UpgradeTo(opts *bind.TransactOpts, newImplementation common.Address) (*types.Transaction, error) {
    return _Contract.contract.Transact(opts, "upgradeTo", newImplementation)
}

// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6.
//
// Solidity: function upgradeTo(address newImplementation) returns()
func (_Contract *ContractSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) {
    return _Contract.Contract.UpgradeTo(&_Contract.TransactOpts, newImplementation)
}

// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6.
//
// Solidity: function upgradeTo(address newImplementation) returns()
func (_Contract *ContractTransactorSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) {
    return _Contract.Contract.UpgradeTo(&_Contract.TransactOpts, newImplementation)
}

// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286.
//
// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns()
func (_Contract *ContractTransactor) UpgradeToAndCall(opts *bind.TransactOpts, newImplementation common.Address, data []byte) (*types.Transaction, error) {
    return _Contract.contract.Transact(opts, "upgradeToAndCall", newImplementation, data)
}

// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286.
//
// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns()
func (_Contract *ContractSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) {
    return _Contract.Contract.UpgradeToAndCall(&_Contract.TransactOpts, newImplementation, data)
}

// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286.
//
// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns()
func (_Contract *ContractTransactorSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) {
    return _Contract.Contract.UpgradeToAndCall(&_Contract.TransactOpts, newImplementation, data)
}

// Fallback is a paid mutator transaction binding the contract fallback function.
//
// Solidity: fallback() payable returns()
func (_Contract *ContractTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) {
    return _Contract.contract.RawTransact(opts, calldata)
}

// Fallback is a paid mutator transaction binding the contract fallback function.
//
// Solidity: fallback() payable returns()
func (_Contract *ContractSession) Fallback(calldata []byte) (*types.Transaction, error) {
    return _Contract.Contract.Fallback(&_Contract.TransactOpts, calldata)
}

// Fallback is a paid mutator transaction binding the contract fallback function.
//
// Solidity: fallback() payable returns()
func (_Contract *ContractTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) {
    return _Contract.Contract.Fallback(&_Contract.TransactOpts, calldata)
}

// ContractAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the Contract contract.
type ContractAdminChangedIterator struct {
    Event *ContractAdminChanged // 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 *ContractAdminChangedIterator) 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(ContractAdminChanged)
            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(ContractAdminChanged)
        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 *ContractAdminChangedIterator) Error() error {
    return it.fail
}

// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *ContractAdminChangedIterator) Close() error {
    it.sub.Unsubscribe()
    return nil
}

// ContractAdminChanged represents a AdminChanged event raised by the Contract contract.
type ContractAdminChanged struct {
    PreviousAdmin common.Address
    NewAdmin      common.Address
    Raw           types.Log // Blockchain specific contextual infos
}

// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f.
//
// Solidity: event AdminChanged(address previousAdmin, address newAdmin)
func (_Contract *ContractFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*ContractAdminChangedIterator, error) {

    logs, sub, err := _Contract.contract.FilterLogs(opts, "AdminChanged")
    if err != nil {
        return nil, err
    }
    return &ContractAdminChangedIterator{contract: _Contract.contract, event: "AdminChanged", logs: logs, sub: sub}, nil
}

// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f.
//
// Solidity: event AdminChanged(address previousAdmin, address newAdmin)
func (_Contract *ContractFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *ContractAdminChanged) (event.Subscription, error) {

    logs, sub, err := _Contract.contract.WatchLogs(opts, "AdminChanged")
    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(ContractAdminChanged)
                if err := _Contract.contract.UnpackLog(event, "AdminChanged", 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
}

// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f.
//
// Solidity: event AdminChanged(address previousAdmin, address newAdmin)
func (_Contract *ContractFilterer) ParseAdminChanged(log types.Log) (*ContractAdminChanged, error) {
    event := new(ContractAdminChanged)
    if err := _Contract.contract.UnpackLog(event, "AdminChanged", log); err != nil {
        return nil, err
    }
    return event, nil
}

// ContractUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the Contract contract.
type ContractUpgradedIterator struct {
    Event *ContractUpgraded // 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 *ContractUpgradedIterator) 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(ContractUpgraded)
            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(ContractUpgraded)
        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 *ContractUpgradedIterator) Error() error {
    return it.fail
}

// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *ContractUpgradedIterator) Close() error {
    it.sub.Unsubscribe()
    return nil
}

// ContractUpgraded represents a Upgraded event raised by the Contract contract.
type ContractUpgraded struct {
    Implementation common.Address
    Raw            types.Log // Blockchain specific contextual infos
}

// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b.
//
// Solidity: event Upgraded(address indexed implementation)
func (_Contract *ContractFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*ContractUpgradedIterator, error) {

    var implementationRule []interface{}
    for _, implementationItem := range implementation {
        implementationRule = append(implementationRule, implementationItem)
    }

    logs, sub, err := _Contract.contract.FilterLogs(opts, "Upgraded", implementationRule)
    if err != nil {
        return nil, err
    }
    return &ContractUpgradedIterator{contract: _Contract.contract, event: "Upgraded", logs: logs, sub: sub}, nil
}

// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b.
//
// Solidity: event Upgraded(address indexed implementation)
func (_Contract *ContractFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *ContractUpgraded, implementation []common.Address) (event.Subscription, error) {

    var implementationRule []interface{}
    for _, implementationItem := range implementation {
        implementationRule = append(implementationRule, implementationItem)
    }

    logs, sub, err := _Contract.contract.WatchLogs(opts, "Upgraded", implementationRule)
    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(ContractUpgraded)
                if err := _Contract.contract.UnpackLog(event, "Upgraded", 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
}

// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b.
//
// Solidity: event Upgraded(address indexed implementation)
func (_Contract *ContractFilterer) ParseUpgraded(log types.Log) (*ContractUpgraded, error) {
    event := new(ContractUpgraded)
    if err := _Contract.contract.UnpackLog(event, "Upgraded", log); err != nil {
        return nil, err
    }
    return event, nil
}