// Code generated via abigen V2 - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.

package bindtests

import (
	"bytes"
	"errors"
	"math/big"

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

// Reference imports to suppress errors if they are not otherwise used.
var (
	_ = bytes.Equal
	_ = errors.New
	_ = big.NewInt
	_ = common.Big1
	_ = types.BloomLookup
	_ = abi.ConvertType
)

// DAOMetaData contains all meta data concerning the DAO contract.
var DAOMetaData = bind.MetaData{
	ABI: "[{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"proposals\",\"outputs\":[{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"votingDeadline\",\"type\":\"uint256\"},{\"name\":\"executed\",\"type\":\"bool\"},{\"name\":\"proposalPassed\",\"type\":\"bool\"},{\"name\":\"numberOfVotes\",\"type\":\"uint256\"},{\"name\":\"currentResult\",\"type\":\"int256\"},{\"name\":\"proposalHash\",\"type\":\"bytes32\"}],\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"proposalNumber\",\"type\":\"uint256\"},{\"name\":\"transactionBytecode\",\"type\":\"bytes\"}],\"name\":\"executeProposal\",\"outputs\":[{\"name\":\"result\",\"type\":\"int256\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"memberId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"numProposals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"members\",\"outputs\":[{\"name\":\"member\",\"type\":\"address\"},{\"name\":\"canVote\",\"type\":\"bool\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"memberSince\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"debatingPeriodInMinutes\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"minimumQuorum\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"targetMember\",\"type\":\"address\"},{\"name\":\"canVote\",\"type\":\"bool\"},{\"name\":\"memberName\",\"type\":\"string\"}],\"name\":\"changeMembership\",\"outputs\":[],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"majorityMargin\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"beneficiary\",\"type\":\"address\"},{\"name\":\"etherAmount\",\"type\":\"uint256\"},{\"name\":\"JobDescription\",\"type\":\"string\"},{\"name\":\"transactionBytecode\",\"type\":\"bytes\"}],\"name\":\"newProposal\",\"outputs\":[{\"name\":\"proposalID\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"minimumQuorumForProposals\",\"type\":\"uint256\"},{\"name\":\"minutesForDebate\",\"type\":\"uint256\"},{\"name\":\"marginOfVotesForMajority\",\"type\":\"int256\"}],\"name\":\"changeVotingRules\",\"outputs\":[],\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"proposalNumber\",\"type\":\"uint256\"},{\"name\":\"supportsProposal\",\"type\":\"bool\"},{\"name\":\"justificationText\",\"type\":\"string\"}],\"name\":\"vote\",\"outputs\":[{\"name\":\"voteID\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"proposalNumber\",\"type\":\"uint256\"},{\"name\":\"beneficiary\",\"type\":\"address\"},{\"name\":\"etherAmount\",\"type\":\"uint256\"},{\"name\":\"transactionBytecode\",\"type\":\"bytes\"}],\"name\":\"checkProposalCode\",\"outputs\":[{\"name\":\"codeChecksOut\",\"type\":\"bool\"}],\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"type\":\"function\"},{\"inputs\":[{\"name\":\"minimumQuorumForProposals\",\"type\":\"uint256\"},{\"name\":\"minutesForDebate\",\"type\":\"uint256\"},{\"name\":\"marginOfVotesForMajority\",\"type\":\"int256\"},{\"name\":\"congressLeader\",\"type\":\"address\"}],\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"proposalID\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"description\",\"type\":\"string\"}],\"name\":\"ProposalAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"proposalID\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"position\",\"type\":\"bool\"},{\"indexed\":false,\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"justification\",\"type\":\"string\"}],\"name\":\"Voted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"proposalID\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"result\",\"type\":\"int256\"},{\"indexed\":false,\"name\":\"quorum\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"active\",\"type\":\"bool\"}],\"name\":\"ProposalTallied\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"isMember\",\"type\":\"bool\"}],\"name\":\"MembershipChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"minimumQuorum\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"debatingPeriodInMinutes\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"majorityMargin\",\"type\":\"int256\"}],\"name\":\"ChangeOfRules\",\"type\":\"event\"}]",
	ID:  "d0a4ad96d49edb1c33461cebc6fb260919",
	Bin: "[encoded data, 10432 characters]",
}

// DAO is an auto generated Go binding around an Ethereum contract.
type DAO struct {
	abi abi.ABI
}

// NewDAO creates a new instance of DAO.
func NewDAO() *DAO {
	parsed, err := DAOMetaData.ParseABI()
	if err != nil {
		panic(errors.New("invalid ABI: " + err.Error()))
	}
	return &DAO{abi: *parsed}
}

// Instance creates a wrapper for a deployed contract instance at the given address.
// Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc.
func (c *DAO) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract {
	return bind.NewBoundContract(addr, c.abi, backend, backend, backend)
}

// PackConstructor is the Go binding used to pack the parameters required for
// contract deployment.
//
// Solidity: constructor(uint256 minimumQuorumForProposals, uint256 minutesForDebate, int256 marginOfVotesForMajority, address congressLeader) returns()
func (dAO *DAO) PackConstructor(minimumQuorumForProposals *big.Int, minutesForDebate *big.Int, marginOfVotesForMajority *big.Int, congressLeader common.Address) []byte {
	enc, err := dAO.abi.Pack("", minimumQuorumForProposals, minutesForDebate, marginOfVotesForMajority, congressLeader)
	if err != nil {
		panic(err)
	}
	return enc
}

// PackChangeMembership is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x9644fcbd.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function changeMembership(address targetMember, bool canVote, string memberName) returns()
func (dAO *DAO) PackChangeMembership(targetMember common.Address, canVote bool, memberName string) []byte {
	enc, err := dAO.abi.Pack("changeMembership", targetMember, canVote, memberName)
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackChangeMembership is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x9644fcbd.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function changeMembership(address targetMember, bool canVote, string memberName) returns()
func (dAO *DAO) TryPackChangeMembership(targetMember common.Address, canVote bool, memberName string) ([]byte, error) {
	return dAO.abi.Pack("changeMembership", targetMember, canVote, memberName)
}

// PackChangeVotingRules is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xbcca1fd3.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function changeVotingRules(uint256 minimumQuorumForProposals, uint256 minutesForDebate, int256 marginOfVotesForMajority) returns()
func (dAO *DAO) PackChangeVotingRules(minimumQuorumForProposals *big.Int, minutesForDebate *big.Int, marginOfVotesForMajority *big.Int) []byte {
	enc, err := dAO.abi.Pack("changeVotingRules", minimumQuorumForProposals, minutesForDebate, marginOfVotesForMajority)
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackChangeVotingRules is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xbcca1fd3.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function changeVotingRules(uint256 minimumQuorumForProposals, uint256 minutesForDebate, int256 marginOfVotesForMajority) returns()
func (dAO *DAO) TryPackChangeVotingRules(minimumQuorumForProposals *big.Int, minutesForDebate *big.Int, marginOfVotesForMajority *big.Int) ([]byte, error) {
	return dAO.abi.Pack("changeVotingRules", minimumQuorumForProposals, minutesForDebate, marginOfVotesForMajority)
}

// PackCheckProposalCode is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xeceb2945.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function checkProposalCode(uint256 proposalNumber, address beneficiary, uint256 etherAmount, bytes transactionBytecode) returns(bool codeChecksOut)
func (dAO *DAO) PackCheckProposalCode(proposalNumber *big.Int, beneficiary common.Address, etherAmount *big.Int, transactionBytecode []byte) []byte {
	enc, err := dAO.abi.Pack("checkProposalCode", proposalNumber, beneficiary, etherAmount, transactionBytecode)
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackCheckProposalCode is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xeceb2945.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function checkProposalCode(uint256 proposalNumber, address beneficiary, uint256 etherAmount, bytes transactionBytecode) returns(bool codeChecksOut)
func (dAO *DAO) TryPackCheckProposalCode(proposalNumber *big.Int, beneficiary common.Address, etherAmount *big.Int, transactionBytecode []byte) ([]byte, error) {
	return dAO.abi.Pack("checkProposalCode", proposalNumber, beneficiary, etherAmount, transactionBytecode)
}

// UnpackCheckProposalCode is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xeceb2945.
//
// Solidity: function checkProposalCode(uint256 proposalNumber, address beneficiary, uint256 etherAmount, bytes transactionBytecode) returns(bool codeChecksOut)
func (dAO *DAO) UnpackCheckProposalCode(data []byte) (bool, error) {
	out, err := dAO.abi.Unpack("checkProposalCode", data)
	if err != nil {
		return *new(bool), err
	}
	out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
	return out0, nil
}

// PackDebatingPeriodInMinutes is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x69bd3436.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function debatingPeriodInMinutes() returns(uint256)
func (dAO *DAO) PackDebatingPeriodInMinutes() []byte {
	enc, err := dAO.abi.Pack("debatingPeriodInMinutes")
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackDebatingPeriodInMinutes is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x69bd3436.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function debatingPeriodInMinutes() returns(uint256)
func (dAO *DAO) TryPackDebatingPeriodInMinutes() ([]byte, error) {
	return dAO.abi.Pack("debatingPeriodInMinutes")
}

// UnpackDebatingPeriodInMinutes is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x69bd3436.
//
// Solidity: function debatingPeriodInMinutes() returns(uint256)
func (dAO *DAO) UnpackDebatingPeriodInMinutes(data []byte) (*big.Int, error) {
	out, err := dAO.abi.Unpack("debatingPeriodInMinutes", data)
	if err != nil {
		return new(big.Int), err
	}
	out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
	return out0, nil
}

// PackExecuteProposal is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x237e9492.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function executeProposal(uint256 proposalNumber, bytes transactionBytecode) returns(int256 result)
func (dAO *DAO) PackExecuteProposal(proposalNumber *big.Int, transactionBytecode []byte) []byte {
	enc, err := dAO.abi.Pack("executeProposal", proposalNumber, transactionBytecode)
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackExecuteProposal is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x237e9492.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function executeProposal(uint256 proposalNumber, bytes transactionBytecode) returns(int256 result)
func (dAO *DAO) TryPackExecuteProposal(proposalNumber *big.Int, transactionBytecode []byte) ([]byte, error) {
	return dAO.abi.Pack("executeProposal", proposalNumber, transactionBytecode)
}

// UnpackExecuteProposal is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x237e9492.
//
// Solidity: function executeProposal(uint256 proposalNumber, bytes transactionBytecode) returns(int256 result)
func (dAO *DAO) UnpackExecuteProposal(data []byte) (*big.Int, error) {
	out, err := dAO.abi.Unpack("executeProposal", data)
	if err != nil {
		return new(big.Int), err
	}
	out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
	return out0, nil
}

// PackMajorityMargin is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xaa02a90f.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function majorityMargin() returns(int256)
func (dAO *DAO) PackMajorityMargin() []byte {
	enc, err := dAO.abi.Pack("majorityMargin")
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackMajorityMargin is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xaa02a90f.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function majorityMargin() returns(int256)
func (dAO *DAO) TryPackMajorityMargin() ([]byte, error) {
	return dAO.abi.Pack("majorityMargin")
}

// UnpackMajorityMargin is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xaa02a90f.
//
// Solidity: function majorityMargin() returns(int256)
func (dAO *DAO) UnpackMajorityMargin(data []byte) (*big.Int, error) {
	out, err := dAO.abi.Unpack("majorityMargin", data)
	if err != nil {
		return new(big.Int), err
	}
	out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
	return out0, nil
}

// PackMemberId is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x39106821.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function memberId(address ) returns(uint256)
func (dAO *DAO) PackMemberId(arg0 common.Address) []byte {
	enc, err := dAO.abi.Pack("memberId", arg0)
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackMemberId is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x39106821.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function memberId(address ) returns(uint256)
func (dAO *DAO) TryPackMemberId(arg0 common.Address) ([]byte, error) {
	return dAO.abi.Pack("memberId", arg0)
}

// UnpackMemberId is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x39106821.
//
// Solidity: function memberId(address ) returns(uint256)
func (dAO *DAO) UnpackMemberId(data []byte) (*big.Int, error) {
	out, err := dAO.abi.Unpack("memberId", data)
	if err != nil {
		return new(big.Int), err
	}
	out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
	return out0, nil
}

// PackMembers is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x5daf08ca.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function members(uint256 ) returns(address member, bool canVote, string name, uint256 memberSince)
func (dAO *DAO) PackMembers(arg0 *big.Int) []byte {
	enc, err := dAO.abi.Pack("members", arg0)
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackMembers is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x5daf08ca.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function members(uint256 ) returns(address member, bool canVote, string name, uint256 memberSince)
func (dAO *DAO) TryPackMembers(arg0 *big.Int) ([]byte, error) {
	return dAO.abi.Pack("members", arg0)
}

// MembersOutput serves as a container for the return parameters of contract
// method Members.
type MembersOutput struct {
	Member      common.Address
	CanVote     bool
	Name        string
	MemberSince *big.Int
}

// UnpackMembers is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x5daf08ca.
//
// Solidity: function members(uint256 ) returns(address member, bool canVote, string name, uint256 memberSince)
func (dAO *DAO) UnpackMembers(data []byte) (MembersOutput, error) {
	out, err := dAO.abi.Unpack("members", data)
	outstruct := new(MembersOutput)
	if err != nil {
		return *outstruct, err
	}
	outstruct.Member = *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
	outstruct.CanVote = *abi.ConvertType(out[1], new(bool)).(*bool)
	outstruct.Name = *abi.ConvertType(out[2], new(string)).(*string)
	outstruct.MemberSince = abi.ConvertType(out[3], new(big.Int)).(*big.Int)
	return *outstruct, nil
}

// PackMinimumQuorum is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x8160f0b5.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function minimumQuorum() returns(uint256)
func (dAO *DAO) PackMinimumQuorum() []byte {
	enc, err := dAO.abi.Pack("minimumQuorum")
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackMinimumQuorum is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x8160f0b5.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function minimumQuorum() returns(uint256)
func (dAO *DAO) TryPackMinimumQuorum() ([]byte, error) {
	return dAO.abi.Pack("minimumQuorum")
}

// UnpackMinimumQuorum is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x8160f0b5.
//
// Solidity: function minimumQuorum() returns(uint256)
func (dAO *DAO) UnpackMinimumQuorum(data []byte) (*big.Int, error) {
	out, err := dAO.abi.Unpack("minimumQuorum", data)
	if err != nil {
		return new(big.Int), err
	}
	out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
	return out0, nil
}

// PackNewProposal is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xb1050da5.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function newProposal(address beneficiary, uint256 etherAmount, string JobDescription, bytes transactionBytecode) returns(uint256 proposalID)
func (dAO *DAO) PackNewProposal(beneficiary common.Address, etherAmount *big.Int, jobDescription string, transactionBytecode []byte) []byte {
	enc, err := dAO.abi.Pack("newProposal", beneficiary, etherAmount, jobDescription, transactionBytecode)
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackNewProposal is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xb1050da5.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function newProposal(address beneficiary, uint256 etherAmount, string JobDescription, bytes transactionBytecode) returns(uint256 proposalID)
func (dAO *DAO) TryPackNewProposal(beneficiary common.Address, etherAmount *big.Int, jobDescription string, transactionBytecode []byte) ([]byte, error) {
	return dAO.abi.Pack("newProposal", beneficiary, etherAmount, jobDescription, transactionBytecode)
}

// UnpackNewProposal is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xb1050da5.
//
// Solidity: function newProposal(address beneficiary, uint256 etherAmount, string JobDescription, bytes transactionBytecode) returns(uint256 proposalID)
func (dAO *DAO) UnpackNewProposal(data []byte) (*big.Int, error) {
	out, err := dAO.abi.Unpack("newProposal", data)
	if err != nil {
		return new(big.Int), err
	}
	out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
	return out0, nil
}

// PackNumProposals is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x400e3949.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function numProposals() returns(uint256)
func (dAO *DAO) PackNumProposals() []byte {
	enc, err := dAO.abi.Pack("numProposals")
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackNumProposals is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x400e3949.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function numProposals() returns(uint256)
func (dAO *DAO) TryPackNumProposals() ([]byte, error) {
	return dAO.abi.Pack("numProposals")
}

// UnpackNumProposals is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x400e3949.
//
// Solidity: function numProposals() returns(uint256)
func (dAO *DAO) UnpackNumProposals(data []byte) (*big.Int, error) {
	out, err := dAO.abi.Unpack("numProposals", data)
	if err != nil {
		return new(big.Int), err
	}
	out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
	return out0, nil
}

// PackOwner is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x8da5cb5b.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function owner() returns(address)
func (dAO *DAO) PackOwner() []byte {
	enc, err := dAO.abi.Pack("owner")
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackOwner is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x8da5cb5b.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function owner() returns(address)
func (dAO *DAO) TryPackOwner() ([]byte, error) {
	return dAO.abi.Pack("owner")
}

// UnpackOwner is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x8da5cb5b.
//
// Solidity: function owner() returns(address)
func (dAO *DAO) UnpackOwner(data []byte) (common.Address, error) {
	out, err := dAO.abi.Unpack("owner", data)
	if err != nil {
		return *new(common.Address), err
	}
	out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
	return out0, nil
}

// PackProposals is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x013cf08b.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function proposals(uint256 ) returns(address recipient, uint256 amount, string description, uint256 votingDeadline, bool executed, bool proposalPassed, uint256 numberOfVotes, int256 currentResult, bytes32 proposalHash)
func (dAO *DAO) PackProposals(arg0 *big.Int) []byte {
	enc, err := dAO.abi.Pack("proposals", arg0)
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackProposals is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x013cf08b.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function proposals(uint256 ) returns(address recipient, uint256 amount, string description, uint256 votingDeadline, bool executed, bool proposalPassed, uint256 numberOfVotes, int256 currentResult, bytes32 proposalHash)
func (dAO *DAO) TryPackProposals(arg0 *big.Int) ([]byte, error) {
	return dAO.abi.Pack("proposals", arg0)
}

// ProposalsOutput serves as a container for the return parameters of contract
// method Proposals.
type ProposalsOutput struct {
	Recipient      common.Address
	Amount         *big.Int
	Description    string
	VotingDeadline *big.Int
	Executed       bool
	ProposalPassed bool
	NumberOfVotes  *big.Int
	CurrentResult  *big.Int
	ProposalHash   [32]byte
}

// UnpackProposals is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x013cf08b.
//
// Solidity: function proposals(uint256 ) returns(address recipient, uint256 amount, string description, uint256 votingDeadline, bool executed, bool proposalPassed, uint256 numberOfVotes, int256 currentResult, bytes32 proposalHash)
func (dAO *DAO) UnpackProposals(data []byte) (ProposalsOutput, error) {
	out, err := dAO.abi.Unpack("proposals", data)
	outstruct := new(ProposalsOutput)
	if err != nil {
		return *outstruct, err
	}
	outstruct.Recipient = *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
	outstruct.Amount = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
	outstruct.Description = *abi.ConvertType(out[2], new(string)).(*string)
	outstruct.VotingDeadline = abi.ConvertType(out[3], new(big.Int)).(*big.Int)
	outstruct.Executed = *abi.ConvertType(out[4], new(bool)).(*bool)
	outstruct.ProposalPassed = *abi.ConvertType(out[5], new(bool)).(*bool)
	outstruct.NumberOfVotes = abi.ConvertType(out[6], new(big.Int)).(*big.Int)
	outstruct.CurrentResult = abi.ConvertType(out[7], new(big.Int)).(*big.Int)
	outstruct.ProposalHash = *abi.ConvertType(out[8], new([32]byte)).(*[32]byte)
	return *outstruct, nil
}

// PackTransferOwnership is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xf2fde38b.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (dAO *DAO) PackTransferOwnership(newOwner common.Address) []byte {
	enc, err := dAO.abi.Pack("transferOwnership", newOwner)
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackTransferOwnership is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xf2fde38b.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (dAO *DAO) TryPackTransferOwnership(newOwner common.Address) ([]byte, error) {
	return dAO.abi.Pack("transferOwnership", newOwner)
}

// PackVote is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd3c0715b.  This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function vote(uint256 proposalNumber, bool supportsProposal, string justificationText) returns(uint256 voteID)
func (dAO *DAO) PackVote(proposalNumber *big.Int, supportsProposal bool, justificationText string) []byte {
	enc, err := dAO.abi.Pack("vote", proposalNumber, supportsProposal, justificationText)
	if err != nil {
		panic(err)
	}
	return enc
}

// TryPackVote is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd3c0715b.  This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function vote(uint256 proposalNumber, bool supportsProposal, string justificationText) returns(uint256 voteID)
func (dAO *DAO) TryPackVote(proposalNumber *big.Int, supportsProposal bool, justificationText string) ([]byte, error) {
	return dAO.abi.Pack("vote", proposalNumber, supportsProposal, justificationText)
}

// UnpackVote is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xd3c0715b.
//
// Solidity: function vote(uint256 proposalNumber, bool supportsProposal, string justificationText) returns(uint256 voteID)
func (dAO *DAO) UnpackVote(data []byte) (*big.Int, error) {
	out, err := dAO.abi.Unpack("vote", data)
	if err != nil {
		return new(big.Int), err
	}
	out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
	return out0, nil
}

// DAOChangeOfRules represents a ChangeOfRules event raised by the DAO contract.
type DAOChangeOfRules struct {
	MinimumQuorum           *big.Int
	DebatingPeriodInMinutes *big.Int
	MajorityMargin          *big.Int
	Raw                     *types.Log // Blockchain specific contextual infos
}

const DAOChangeOfRulesEventName = "ChangeOfRules"

// ContractEventName returns the user-defined event name.
func (DAOChangeOfRules) ContractEventName() string {
	return DAOChangeOfRulesEventName
}

// UnpackChangeOfRulesEvent is the Go binding that unpacks the event data emitted
// by contract.
//
// Solidity: event ChangeOfRules(uint256 minimumQuorum, uint256 debatingPeriodInMinutes, int256 majorityMargin)
func (dAO *DAO) UnpackChangeOfRulesEvent(log *types.Log) (*DAOChangeOfRules, error) {
	event := "ChangeOfRules"
	if log.Topics[0] != dAO.abi.Events[event].ID {
		return nil, errors.New("event signature mismatch")
	}
	out := new(DAOChangeOfRules)
	if len(log.Data) > 0 {
		if err := dAO.abi.UnpackIntoInterface(out, event, log.Data); err != nil {
			return nil, err
		}
	}
	var indexed abi.Arguments
	for _, arg := range dAO.abi.Events[event].Inputs {
		if arg.Indexed {
			indexed = append(indexed, arg)
		}
	}
	if err := abi.ParseTopics(out, indexed, log.Topics[1:]); err != nil {
		return nil, err
	}
	out.Raw = log
	return out, nil
}

// DAOMembershipChanged represents a MembershipChanged event raised by the DAO contract.
type DAOMembershipChanged struct {
	Member   common.Address
	IsMember bool
	Raw      *types.Log // Blockchain specific contextual infos
}

const DAOMembershipChangedEventName = "MembershipChanged"

// ContractEventName returns the user-defined event name.
func (DAOMembershipChanged) ContractEventName() string {
	return DAOMembershipChangedEventName
}

// UnpackMembershipChangedEvent is the Go binding that unpacks the event data emitted
// by contract.
//
// Solidity: event MembershipChanged(address member, bool isMember)
func (dAO *DAO) UnpackMembershipChangedEvent(log *types.Log) (*DAOMembershipChanged, error) {
	event := "MembershipChanged"
	if log.Topics[0] != dAO.abi.Events[event].ID {
		return nil, errors.New("event signature mismatch")
	}
	out := new(DAOMembershipChanged)
	if len(log.Data) > 0 {
		if err := dAO.abi.UnpackIntoInterface(out, event, log.Data); err != nil {
			return nil, err
		}
	}
	var indexed abi.Arguments
	for _, arg := range dAO.abi.Events[event].Inputs {
		if arg.Indexed {
			indexed = append(indexed, arg)
		}
	}
	if err := abi.ParseTopics(out, indexed, log.Topics[1:]); err != nil {
		return nil, err
	}
	out.Raw = log
	return out, nil
}

// DAOProposalAdded represents a ProposalAdded event raised by the DAO contract.
type DAOProposalAdded struct {
	ProposalID  *big.Int
	Recipient   common.Address
	Amount      *big.Int
	Description string
	Raw         *types.Log // Blockchain specific contextual infos
}

const DAOProposalAddedEventName = "ProposalAdded"

// ContractEventName returns the user-defined event name.
func (DAOProposalAdded) ContractEventName() string {
	return DAOProposalAddedEventName
}

// UnpackProposalAddedEvent is the Go binding that unpacks the event data emitted
// by contract.
//
// Solidity: event ProposalAdded(uint256 proposalID, address recipient, uint256 amount, string description)
func (dAO *DAO) UnpackProposalAddedEvent(log *types.Log) (*DAOProposalAdded, error) {
	event := "ProposalAdded"
	if log.Topics[0] != dAO.abi.Events[event].ID {
		return nil, errors.New("event signature mismatch")
	}
	out := new(DAOProposalAdded)
	if len(log.Data) > 0 {
		if err := dAO.abi.UnpackIntoInterface(out, event, log.Data); err != nil {
			return nil, err
		}
	}
	var indexed abi.Arguments
	for _, arg := range dAO.abi.Events[event].Inputs {
		if arg.Indexed {
			indexed = append(indexed, arg)
		}
	}
	if err := abi.ParseTopics(out, indexed, log.Topics[1:]); err != nil {
		return nil, err
	}
	out.Raw = log
	return out, nil
}

// DAOProposalTallied represents a ProposalTallied event raised by the DAO contract.
type DAOProposalTallied struct {
	ProposalID *big.Int
	Result     *big.Int
	Quorum     *big.Int
	Active     bool
	Raw        *types.Log // Blockchain specific contextual infos
}

const DAOProposalTalliedEventName = "ProposalTallied"

// ContractEventName returns the user-defined event name.
func (DAOProposalTallied) ContractEventName() string {
	return DAOProposalTalliedEventName
}

// UnpackProposalTalliedEvent is the Go binding that unpacks the event data emitted
// by contract.
//
// Solidity: event ProposalTallied(uint256 proposalID, int256 result, uint256 quorum, bool active)
func (dAO *DAO) UnpackProposalTalliedEvent(log *types.Log) (*DAOProposalTallied, error) {
	event := "ProposalTallied"
	if log.Topics[0] != dAO.abi.Events[event].ID {
		return nil, errors.New("event signature mismatch")
	}
	out := new(DAOProposalTallied)
	if len(log.Data) > 0 {
		if err := dAO.abi.UnpackIntoInterface(out, event, log.Data); err != nil {
			return nil, err
		}
	}
	var indexed abi.Arguments
	for _, arg := range dAO.abi.Events[event].Inputs {
		if arg.Indexed {
			indexed = append(indexed, arg)
		}
	}
	if err := abi.ParseTopics(out, indexed, log.Topics[1:]); err != nil {
		return nil, err
	}
	out.Raw = log
	return out, nil
}

// DAOVoted represents a Voted event raised by the DAO contract.
type DAOVoted struct {
	ProposalID    *big.Int
	Position      bool
	Voter         common.Address
	Justification string
	Raw           *types.Log // Blockchain specific contextual infos
}

const DAOVotedEventName = "Voted"

// ContractEventName returns the user-defined event name.
func (DAOVoted) ContractEventName() string {
	return DAOVotedEventName
}

// UnpackVotedEvent is the Go binding that unpacks the event data emitted
// by contract.
//
// Solidity: event Voted(uint256 proposalID, bool position, address voter, string justification)
func (dAO *DAO) UnpackVotedEvent(log *types.Log) (*DAOVoted, error) {
	event := "Voted"
	if log.Topics[0] != dAO.abi.Events[event].ID {
		return nil, errors.New("event signature mismatch")
	}
	out := new(DAOVoted)
	if len(log.Data) > 0 {
		if err := dAO.abi.UnpackIntoInterface(out, event, log.Data); err != nil {
			return nil, err
		}
	}
	var indexed abi.Arguments
	for _, arg := range dAO.abi.Events[event].Inputs {
		if arg.Indexed {
			indexed = append(indexed, arg)
		}
	}
	if err := abi.ParseTopics(out, indexed, log.Topics[1:]); err != nil {
		return nil, err
	}
	out.Raw = log
	return out, nil
}
