KNWToken.go 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  1. // Code generated - DO NOT EDIT.
  2. // This file is a generated binding and any manual changes will be lost.
  3. package KNWToken
  4. import (
  5. "math/big"
  6. "strings"
  7. ethereum "github.com/ethereum/go-ethereum"
  8. "github.com/ethereum/go-ethereum/accounts/abi"
  9. "github.com/ethereum/go-ethereum/accounts/abi/bind"
  10. "github.com/ethereum/go-ethereum/common"
  11. "github.com/ethereum/go-ethereum/core/types"
  12. "github.com/ethereum/go-ethereum/event"
  13. )
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var (
  16. _ = big.NewInt
  17. _ = strings.NewReader
  18. _ = ethereum.NotFound
  19. _ = abi.U256
  20. _ = bind.Bind
  21. _ = common.Big1
  22. _ = types.BloomLookup
  23. _ = event.NewSubscription
  24. )
  25. // KNWTokenABI is the input ABI used to generate the binding from.
  26. const KNWTokenABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"},{\"name\":\"_label\",\"type\":\"string\"}],\"name\":\"freeBalanceOfLabel\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"},{\"name\":\"_label\",\"type\":\"string\"}],\"name\":\"lockTokens\",\"outputs\":[{\"name\":\"numberOfTokens\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"},{\"name\":\"_label\",\"type\":\"string\"},{\"name\":\"_winningPercentage\",\"type\":\"uint256\"},{\"name\":\"_mintingMethod\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"},{\"name\":\"_labelID\",\"type\":\"uint256\"}],\"name\":\"labelOfAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newVotingAddress\",\"type\":\"address\"}],\"name\":\"setVotingAddress\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"},{\"name\":\"_label\",\"type\":\"string\"},{\"name\":\"_stakedTokens\",\"type\":\"uint256\"},{\"name\":\"_winningPercentage\",\"type\":\"uint256\"},{\"name\":\"_burningMethod\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"},{\"name\":\"_label\",\"type\":\"string\"}],\"name\":\"balanceOfLabel\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_label\",\"type\":\"string\"}],\"name\":\"totalLabelSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"votingAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"},{\"name\":\"_label\",\"type\":\"string\"},{\"name\":\"_numberOfTokens\",\"type\":\"uint256\"}],\"name\":\"unlockTokens\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"labelCountOfAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"who\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"label\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"who\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"label\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Burn\",\"type\":\"event\"}]"
  27. // KNWTokenBin is the compiled bytecode used for deploying new contracts.
  28. const KNWTokenBin = `0x608060405234801561001057600080fd5b506119f7806100206000396000f3006080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306970f1c81146100df57806306fdde031461015857806318160ddd146101e25780631d3316d0146101f7578063313ce5671461025e5780634a5dc3aa1461028957806358e546cf146102be5780637a6cfcab146102e257806395d89b4114610303578063994dd93a14610318578063b88c0f981461034e578063c1a63f3c146103b5578063d2fa71701461040e578063d950df341461043f578063e7017fc4146104a8575b600080fd5b3480156100eb57600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610146958335600160a060020a03169536956044949193909101919081908401838280828437509497506104c99650505050505050565b60408051918252519081900360200190f35b34801561016457600080fd5b5061016d6105ca565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a757818101518382015260200161018f565b50505050905090810190601f1680156101d45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ee57600080fd5b50610146610601565b34801561020357600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610146958335600160a060020a03169536956044949193909101919081908401838280828437509497506106089650505050505050565b34801561026a57600080fd5b506102736108e0565b6040805160ff9092168252519081900360200190f35b34801561029557600080fd5b506102bc60048035600160a060020a031690602480359081019101356044356064356108e5565b005b3480156102ca57600080fd5b5061016d600160a060020a0360043516602435610c67565b3480156102ee57600080fd5b506102bc600160a060020a0360043516610d19565b34801561030f57600080fd5b5061016d610e0b565b34801561032457600080fd5b506102bc60048035600160a060020a03169060248035908101910135604435606435608435610e42565b34801561035a57600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610146958335600160a060020a03169536956044949193909101919081908401838280828437509497506113339650505050505050565b3480156103c157600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526101469436949293602493928401919081908401838280828437509497506113b19650505050505050565b34801561041a57600080fd5b50610423611419565b60408051600160a060020a039092168252519081900360200190f35b34801561044b57600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526102bc958335600160a060020a031695369560449491939091019190819084018382808284375094975050933594506114289350505050565b3480156104b457600080fd5b50610146600160a060020a03600435166116df565b600160a060020a0382166000908152600160209081526040808320905184516105c39386929182918401908083835b602083106105175780518252601f1990920191602091820191016104f8565b51815160209384036101000a600019018019909216911617905292019485525060408051948590038201852054600160a060020a038a1660009081528084529190912088519195909450889350918291908401908083835b6020831061058e5780518252601f19909201916020918201910161056f565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054929150506116fa565b9392505050565b60408051808201909152600f81527f4b6e6f776c6564676520546f6b656e0000000000000000000000000000000000602082015281565b6004545b90565b600654600090600160a060020a0316331461066f576040805160e560020a62461bcd02815260206004820152603360248201526000805160206119ac833981519152604482015260008051602061198c833981519152606482015290519081900360840190fd5b50600160a060020a0382166000908152600160209081526040808320905184519192859282918401908083835b602083106106bb5780518252601f19909201916020918201910161069c565b51815160209384036101000a600019018019909216911617905292019485525060408051948590038201852054600160a060020a03891660009081528084529190912087519195909450879350918291908401908083835b602083106107325780518252601f199092019160209182019101610713565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390205411156108da576107c36001600085600160a060020a0316600160a060020a0316815260200190815260200160002083604051808280519060200190808383602083106105175780518252601f1990920191602091820191016104f8565b9050610853816001600086600160a060020a0316600160a060020a03168152602001908152602001600020846040518082805190602001908083835b6020831061081e5780518252601f1990920191602091820191016107ff565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205492915050611789565b6001600085600160a060020a0316600160a060020a03168152602001908152602001600020836040518082805190602001908083835b602083106108a85780518252601f199092019160209182019101610889565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092209290925550505b92915050565b601281565b600654600090600160a060020a0316331461094c576040805160e560020a62461bcd02815260206004820152603360248201526000805160206119ac833981519152604482015260008051602061198c833981519152606482015290519081900360840190fd5b600160a060020a03861615156109ac576040805160e560020a62461bcd02815260206004820152601660248201527f416464726573732063616e277420626520656d70747900000000000000000000604482015290519081900360640190fd5b60008411610a04576040805160e560020a62461bcd02815260206004820152601e60248201527f4b6e6f776c656467652d4c6162656c2063616e277420626520656d7074790000604482015290519081900360640190fd5b506000811515610a3957610a3666470de4df820000610a2a85603263ffffffff6116fa16565b9063ffffffff61180c16565b90505b600454610a4c908263ffffffff61178916565b600481905550610a89816005878760405180838380828437909101948552505060405192839003602001909220549291505063ffffffff61178916565b6005868660405180838380828437909101948552505060408051938490036020908101852095909555600160a060020a038b16600090815294859052909320925087918791508083838082843782019150509250505090815260200160405180910390205460001415610b5957600160a060020a038616600090815260036020526040902054610b2090600163ffffffff61178916565b600160a060020a03871660009081526003602090815260408083208490556002825280832093835292905220610b579086866118f3565b505b610bb28160008089600160a060020a0316600160a060020a03168152602001908152602001600020878760405180838380828437909101948552505060405192839003602001909220549291505063ffffffff61178916565b60008088600160a060020a0316600160a060020a0316815260200190815260200160002086866040518083838082843782019150509250505090815260200160405180910390208190555085600160a060020a03167fec4de1eef14af3ae5d77facf1ed7a9d3d50f6285573ee0ec155fc11217fc3442868684604051808060200183815260200182810382528585828181526020019250808284376040519201829003965090945050505050a2505050505050565b600160a060020a0382166000908152600260208181526040808420858552825292839020805484516001821615610100026000190190911693909304601f81018390048302840183019094528383526060939091830182828015610d0c5780601f10610ce157610100808354040283529160200191610d0c565b820191906000526020600020905b815481529060010190602001808311610cef57829003601f168201915b5050505050905092915050565b600160a060020a03811615801590610d3a5750600654600160a060020a0316155b1515610ddc576040805160e560020a62461bcd02815260206004820152604f60248201527f4b4e57566f74696e6720616464726573732063616e206f6e6c7920626520736560448201527f742069662069742773206e6f7420656d70747920616e64206861736e2774206160648201527f6c7265616479206265656e207365740000000000000000000000000000000000608482015290519081900360a40190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60408051808201909152600381527f4b4e570000000000000000000000000000000000000000000000000000000000602082015281565b60065460009081908190600160a060020a03163314610ead576040805160e560020a62461bcd02815260206004820152603360248201526000805160206119ac833981519152604482015260008051602061198c833981519152606482015290519081900360840190fd5b600160a060020a0389161515610f0d576040805160e560020a62461bcd02815260206004820152601660248201527f416464726573732063616e277420626520656d70747900000000000000000000604482015290519081900360640190fd5b60008711610f65576040805160e560020a62461bcd02815260206004820152601e60248201527f4b6e6f776c656467652d4c6162656c2063616e277420626520656d7074790000604482015290519081900360640190fd5b856000808b600160a060020a0316600160a060020a031681526020019081526020016000208989604051808383808284378201915050925050509081526020016040518091039020541015151561102c576040805160e560020a62461bcd02815260206004820152602a60248201527f43616e2774206275726e206d6f7265204b4e57207468616e207468652061646460448201527f7265737320686f6c647300000000000000000000000000000000000000000000606482015290519081900360840190fd5b85925060008611156113285783151561113d5761110366038d7ea4c6800061105f8864e8d4a5100063ffffffff61188516565b73__libraries/SafeMath.sol:SafeMath_______63677342ce90916040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b1580156110cb57600080fd5b505af41580156110df573d6000803e3d6000fd5b505050506040513d60208110156110f557600080fd5b50519063ffffffff61180c16565b9150858210156111245761111d838363ffffffff6116fa16565b9250611138565b61113583600263ffffffff61188516565b92505b6111a8565b83600114156111575761113583600263ffffffff61188516565b83600214156111a857611182606461117687600263ffffffff61180c16565b9063ffffffff6116fa16565b90506111a56064611199858463ffffffff61180c16565b9063ffffffff61188516565b92505b6004546111bb908463ffffffff6116fa16565b6004819055506111f88360058a8a60405180838380828437909101948552505060405192839003602001909220549291505063ffffffff6116fa16565b600589896040518083838082843782019150509250505090815260200160405180910390208190555061127a836000808c600160a060020a0316600160a060020a031681526020019081526020016000208a8a60405180838380828437909101948552505060405192839003602001909220549291505063ffffffff6116fa16565b6000808b600160a060020a0316600160a060020a0316815260200190815260200160002089896040518083838082843782019150509250505090815260200160405180910390208190555088600160a060020a03167ffdf096248d2b7b0aef506231c043107c21faacc26193881b3f0cdc8b5479692a898986604051808060200183815260200182810382528585828181526020019250808284376040519201829003965090945050505050a25b505050505050505050565b600160a060020a038216600090815260208181526040808320905184519192859282918401908083835b6020831061137c5780518252601f19909201916020918201910161135d565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205495945050505050565b60006005826040518082805190602001908083835b602083106113e55780518252601f1990920191602091820191016113c6565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054949350505050565b600654600160a060020a031681565b600654600160a060020a0316331461148c576040805160e560020a62461bcd02815260206004820152603360248201526000805160206119ac833981519152604482015260008051602061198c833981519152606482015290519081900360840190fd5b600160a060020a038316600090815260208181526040918290209151845185928291908401908083835b602083106114d55780518252601f1990920191602091820191016114b6565b51815160209384036101000a600019018019909216911617905292019485525060408051948590038201852054600160a060020a0389166000908152600184529190912087519195909450879350918291908401908083835b6020831061154d5780518252601f19909201916020918201910161152e565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054929092111591506115fc9050576040805160e560020a62461bcd02815260206004820152602660248201527f43616e74206c6f636b206d6f7265204b4e57207468616e20616e20616464726560448201527f7373206861730000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b611654816001600086600160a060020a0316600160a060020a03168152602001908152602001600020846040518082805190602001908083836020831061058e5780518252601f19909201916020918201910161056f565b6001600085600160a060020a0316600160a060020a03168152602001908152602001600020836040518082805190602001908083835b602083106116a95780518252601f19909201916020918201910161168a565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220929092555050505050565b600160a060020a031660009081526003602052604090205490565b6000808383111561177b576040805160e560020a62461bcd02815260206004820152603560248201527f43616e27742073756274726163742061206e756d6265722066726f6d2061207360448201527f6d616c6c6572206f6e6520776974682075696e74730000000000000000000000606482015290519081900360840190fd5b5050808203805b5092915050565b6000828201838110156105c3576040805160e560020a62461bcd02815260206004820152602a60248201527f526573756c742068617320746f20626520626967676572207468616e20626f7460448201527f682073756d6d616e647300000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008083151561181f5760009150611782565b5082820282848281151561182f57fe5b04146105c3576040805160e560020a62461bcd02815260206004820152601f60248201527f466c6177656420696e70757420666f72206d756c7469706c69636174696f6e00604482015290519081900360640190fd5b6000808083116118df576040805160e560020a62461bcd02815260206004820152601460248201527f43616e277420646976696465206279207a65726f000000000000000000000000604482015290519081900360640190fd5b82848115156118ea57fe5b04949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106119345782800160ff19823516178555611961565b82800160010185558215611961579182015b82811115611961578235825591602001919060010190611946565b5061196d929150611971565b5090565b61060591905b8082111561196d576000815560010161197756006c6c6f77656420746f2063616c6c2074686973000000000000000000000000004f6e6c7920746865204b4e57566f74696e6720636f6e74726163742069732061a165627a7a723058203a0a305bfaea031add5c672d6d2f405ffc93b4ceb613b4124f09f4420909a3ea0029`
  29. // DeployKNWToken deploys a new Ethereum contract, binding an instance of KNWToken to it.
  30. func DeployKNWToken(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *KNWToken, error) {
  31. parsed, err := abi.JSON(strings.NewReader(KNWTokenABI))
  32. if err != nil {
  33. return common.Address{}, nil, nil, err
  34. }
  35. address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(KNWTokenBin), backend)
  36. if err != nil {
  37. return common.Address{}, nil, nil, err
  38. }
  39. return address, tx, &KNWToken{KNWTokenCaller: KNWTokenCaller{contract: contract}, KNWTokenTransactor: KNWTokenTransactor{contract: contract}, KNWTokenFilterer: KNWTokenFilterer{contract: contract}}, nil
  40. }
  41. // KNWToken is an auto generated Go binding around an Ethereum contract.
  42. type KNWToken struct {
  43. KNWTokenCaller // Read-only binding to the contract
  44. KNWTokenTransactor // Write-only binding to the contract
  45. KNWTokenFilterer // Log filterer for contract events
  46. }
  47. // KNWTokenCaller is an auto generated read-only Go binding around an Ethereum contract.
  48. type KNWTokenCaller struct {
  49. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  50. }
  51. // KNWTokenTransactor is an auto generated write-only Go binding around an Ethereum contract.
  52. type KNWTokenTransactor struct {
  53. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  54. }
  55. // KNWTokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
  56. type KNWTokenFilterer struct {
  57. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  58. }
  59. // KNWTokenSession is an auto generated Go binding around an Ethereum contract,
  60. // with pre-set call and transact options.
  61. type KNWTokenSession struct {
  62. Contract *KNWToken // Generic contract binding to set the session for
  63. CallOpts bind.CallOpts // Call options to use throughout this session
  64. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  65. }
  66. // KNWTokenCallerSession is an auto generated read-only Go binding around an Ethereum contract,
  67. // with pre-set call options.
  68. type KNWTokenCallerSession struct {
  69. Contract *KNWTokenCaller // Generic contract caller binding to set the session for
  70. CallOpts bind.CallOpts // Call options to use throughout this session
  71. }
  72. // KNWTokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
  73. // with pre-set transact options.
  74. type KNWTokenTransactorSession struct {
  75. Contract *KNWTokenTransactor // Generic contract transactor binding to set the session for
  76. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  77. }
  78. // KNWTokenRaw is an auto generated low-level Go binding around an Ethereum contract.
  79. type KNWTokenRaw struct {
  80. Contract *KNWToken // Generic contract binding to access the raw methods on
  81. }
  82. // KNWTokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
  83. type KNWTokenCallerRaw struct {
  84. Contract *KNWTokenCaller // Generic read-only contract binding to access the raw methods on
  85. }
  86. // KNWTokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
  87. type KNWTokenTransactorRaw struct {
  88. Contract *KNWTokenTransactor // Generic write-only contract binding to access the raw methods on
  89. }
  90. // NewKNWToken creates a new instance of KNWToken, bound to a specific deployed contract.
  91. func NewKNWToken(address common.Address, backend bind.ContractBackend) (*KNWToken, error) {
  92. contract, err := bindKNWToken(address, backend, backend, backend)
  93. if err != nil {
  94. return nil, err
  95. }
  96. return &KNWToken{KNWTokenCaller: KNWTokenCaller{contract: contract}, KNWTokenTransactor: KNWTokenTransactor{contract: contract}, KNWTokenFilterer: KNWTokenFilterer{contract: contract}}, nil
  97. }
  98. // NewKNWTokenCaller creates a new read-only instance of KNWToken, bound to a specific deployed contract.
  99. func NewKNWTokenCaller(address common.Address, caller bind.ContractCaller) (*KNWTokenCaller, error) {
  100. contract, err := bindKNWToken(address, caller, nil, nil)
  101. if err != nil {
  102. return nil, err
  103. }
  104. return &KNWTokenCaller{contract: contract}, nil
  105. }
  106. // NewKNWTokenTransactor creates a new write-only instance of KNWToken, bound to a specific deployed contract.
  107. func NewKNWTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*KNWTokenTransactor, error) {
  108. contract, err := bindKNWToken(address, nil, transactor, nil)
  109. if err != nil {
  110. return nil, err
  111. }
  112. return &KNWTokenTransactor{contract: contract}, nil
  113. }
  114. // NewKNWTokenFilterer creates a new log filterer instance of KNWToken, bound to a specific deployed contract.
  115. func NewKNWTokenFilterer(address common.Address, filterer bind.ContractFilterer) (*KNWTokenFilterer, error) {
  116. contract, err := bindKNWToken(address, nil, nil, filterer)
  117. if err != nil {
  118. return nil, err
  119. }
  120. return &KNWTokenFilterer{contract: contract}, nil
  121. }
  122. // bindKNWToken binds a generic wrapper to an already deployed contract.
  123. func bindKNWToken(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
  124. parsed, err := abi.JSON(strings.NewReader(KNWTokenABI))
  125. if err != nil {
  126. return nil, err
  127. }
  128. return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
  129. }
  130. // Call invokes the (constant) contract method with params as input values and
  131. // sets the output to result. The result type might be a single field for simple
  132. // returns, a slice of interfaces for anonymous returns and a struct for named
  133. // returns.
  134. func (_KNWToken *KNWTokenRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  135. return _KNWToken.Contract.KNWTokenCaller.contract.Call(opts, result, method, params...)
  136. }
  137. // Transfer initiates a plain transaction to move funds to the contract, calling
  138. // its default method if one is available.
  139. func (_KNWToken *KNWTokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  140. return _KNWToken.Contract.KNWTokenTransactor.contract.Transfer(opts)
  141. }
  142. // Transact invokes the (paid) contract method with params as input values.
  143. func (_KNWToken *KNWTokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  144. return _KNWToken.Contract.KNWTokenTransactor.contract.Transact(opts, method, params...)
  145. }
  146. // Call invokes the (constant) contract method with params as input values and
  147. // sets the output to result. The result type might be a single field for simple
  148. // returns, a slice of interfaces for anonymous returns and a struct for named
  149. // returns.
  150. func (_KNWToken *KNWTokenCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  151. return _KNWToken.Contract.contract.Call(opts, result, method, params...)
  152. }
  153. // Transfer initiates a plain transaction to move funds to the contract, calling
  154. // its default method if one is available.
  155. func (_KNWToken *KNWTokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  156. return _KNWToken.Contract.contract.Transfer(opts)
  157. }
  158. // Transact invokes the (paid) contract method with params as input values.
  159. func (_KNWToken *KNWTokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  160. return _KNWToken.Contract.contract.Transact(opts, method, params...)
  161. }
  162. // BalanceOfLabel is a free data retrieval call binding the contract method 0xb88c0f98.
  163. //
  164. // Solidity: function balanceOfLabel(_address address, _label string) constant returns(uint256)
  165. func (_KNWToken *KNWTokenCaller) BalanceOfLabel(opts *bind.CallOpts, _address common.Address, _label string) (*big.Int, error) {
  166. var (
  167. ret0 = new(*big.Int)
  168. )
  169. out := ret0
  170. err := _KNWToken.contract.Call(opts, out, "balanceOfLabel", _address, _label)
  171. return *ret0, err
  172. }
  173. // BalanceOfLabel is a free data retrieval call binding the contract method 0xb88c0f98.
  174. //
  175. // Solidity: function balanceOfLabel(_address address, _label string) constant returns(uint256)
  176. func (_KNWToken *KNWTokenSession) BalanceOfLabel(_address common.Address, _label string) (*big.Int, error) {
  177. return _KNWToken.Contract.BalanceOfLabel(&_KNWToken.CallOpts, _address, _label)
  178. }
  179. // BalanceOfLabel is a free data retrieval call binding the contract method 0xb88c0f98.
  180. //
  181. // Solidity: function balanceOfLabel(_address address, _label string) constant returns(uint256)
  182. func (_KNWToken *KNWTokenCallerSession) BalanceOfLabel(_address common.Address, _label string) (*big.Int, error) {
  183. return _KNWToken.Contract.BalanceOfLabel(&_KNWToken.CallOpts, _address, _label)
  184. }
  185. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
  186. //
  187. // Solidity: function decimals() constant returns(uint8)
  188. func (_KNWToken *KNWTokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) {
  189. var (
  190. ret0 = new(uint8)
  191. )
  192. out := ret0
  193. err := _KNWToken.contract.Call(opts, out, "decimals")
  194. return *ret0, err
  195. }
  196. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
  197. //
  198. // Solidity: function decimals() constant returns(uint8)
  199. func (_KNWToken *KNWTokenSession) Decimals() (uint8, error) {
  200. return _KNWToken.Contract.Decimals(&_KNWToken.CallOpts)
  201. }
  202. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
  203. //
  204. // Solidity: function decimals() constant returns(uint8)
  205. func (_KNWToken *KNWTokenCallerSession) Decimals() (uint8, error) {
  206. return _KNWToken.Contract.Decimals(&_KNWToken.CallOpts)
  207. }
  208. // FreeBalanceOfLabel is a free data retrieval call binding the contract method 0x06970f1c.
  209. //
  210. // Solidity: function freeBalanceOfLabel(_address address, _label string) constant returns(uint256)
  211. func (_KNWToken *KNWTokenCaller) FreeBalanceOfLabel(opts *bind.CallOpts, _address common.Address, _label string) (*big.Int, error) {
  212. var (
  213. ret0 = new(*big.Int)
  214. )
  215. out := ret0
  216. err := _KNWToken.contract.Call(opts, out, "freeBalanceOfLabel", _address, _label)
  217. return *ret0, err
  218. }
  219. // FreeBalanceOfLabel is a free data retrieval call binding the contract method 0x06970f1c.
  220. //
  221. // Solidity: function freeBalanceOfLabel(_address address, _label string) constant returns(uint256)
  222. func (_KNWToken *KNWTokenSession) FreeBalanceOfLabel(_address common.Address, _label string) (*big.Int, error) {
  223. return _KNWToken.Contract.FreeBalanceOfLabel(&_KNWToken.CallOpts, _address, _label)
  224. }
  225. // FreeBalanceOfLabel is a free data retrieval call binding the contract method 0x06970f1c.
  226. //
  227. // Solidity: function freeBalanceOfLabel(_address address, _label string) constant returns(uint256)
  228. func (_KNWToken *KNWTokenCallerSession) FreeBalanceOfLabel(_address common.Address, _label string) (*big.Int, error) {
  229. return _KNWToken.Contract.FreeBalanceOfLabel(&_KNWToken.CallOpts, _address, _label)
  230. }
  231. // LabelCountOfAddress is a free data retrieval call binding the contract method 0xe7017fc4.
  232. //
  233. // Solidity: function labelCountOfAddress(_address address) constant returns(uint256)
  234. func (_KNWToken *KNWTokenCaller) LabelCountOfAddress(opts *bind.CallOpts, _address common.Address) (*big.Int, error) {
  235. var (
  236. ret0 = new(*big.Int)
  237. )
  238. out := ret0
  239. err := _KNWToken.contract.Call(opts, out, "labelCountOfAddress", _address)
  240. return *ret0, err
  241. }
  242. // LabelCountOfAddress is a free data retrieval call binding the contract method 0xe7017fc4.
  243. //
  244. // Solidity: function labelCountOfAddress(_address address) constant returns(uint256)
  245. func (_KNWToken *KNWTokenSession) LabelCountOfAddress(_address common.Address) (*big.Int, error) {
  246. return _KNWToken.Contract.LabelCountOfAddress(&_KNWToken.CallOpts, _address)
  247. }
  248. // LabelCountOfAddress is a free data retrieval call binding the contract method 0xe7017fc4.
  249. //
  250. // Solidity: function labelCountOfAddress(_address address) constant returns(uint256)
  251. func (_KNWToken *KNWTokenCallerSession) LabelCountOfAddress(_address common.Address) (*big.Int, error) {
  252. return _KNWToken.Contract.LabelCountOfAddress(&_KNWToken.CallOpts, _address)
  253. }
  254. // LabelOfAddress is a free data retrieval call binding the contract method 0x58e546cf.
  255. //
  256. // Solidity: function labelOfAddress(_address address, _labelID uint256) constant returns(string)
  257. func (_KNWToken *KNWTokenCaller) LabelOfAddress(opts *bind.CallOpts, _address common.Address, _labelID *big.Int) (string, error) {
  258. var (
  259. ret0 = new(string)
  260. )
  261. out := ret0
  262. err := _KNWToken.contract.Call(opts, out, "labelOfAddress", _address, _labelID)
  263. return *ret0, err
  264. }
  265. // LabelOfAddress is a free data retrieval call binding the contract method 0x58e546cf.
  266. //
  267. // Solidity: function labelOfAddress(_address address, _labelID uint256) constant returns(string)
  268. func (_KNWToken *KNWTokenSession) LabelOfAddress(_address common.Address, _labelID *big.Int) (string, error) {
  269. return _KNWToken.Contract.LabelOfAddress(&_KNWToken.CallOpts, _address, _labelID)
  270. }
  271. // LabelOfAddress is a free data retrieval call binding the contract method 0x58e546cf.
  272. //
  273. // Solidity: function labelOfAddress(_address address, _labelID uint256) constant returns(string)
  274. func (_KNWToken *KNWTokenCallerSession) LabelOfAddress(_address common.Address, _labelID *big.Int) (string, error) {
  275. return _KNWToken.Contract.LabelOfAddress(&_KNWToken.CallOpts, _address, _labelID)
  276. }
  277. // Name is a free data retrieval call binding the contract method 0x06fdde03.
  278. //
  279. // Solidity: function name() constant returns(string)
  280. func (_KNWToken *KNWTokenCaller) Name(opts *bind.CallOpts) (string, error) {
  281. var (
  282. ret0 = new(string)
  283. )
  284. out := ret0
  285. err := _KNWToken.contract.Call(opts, out, "name")
  286. return *ret0, err
  287. }
  288. // Name is a free data retrieval call binding the contract method 0x06fdde03.
  289. //
  290. // Solidity: function name() constant returns(string)
  291. func (_KNWToken *KNWTokenSession) Name() (string, error) {
  292. return _KNWToken.Contract.Name(&_KNWToken.CallOpts)
  293. }
  294. // Name is a free data retrieval call binding the contract method 0x06fdde03.
  295. //
  296. // Solidity: function name() constant returns(string)
  297. func (_KNWToken *KNWTokenCallerSession) Name() (string, error) {
  298. return _KNWToken.Contract.Name(&_KNWToken.CallOpts)
  299. }
  300. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
  301. //
  302. // Solidity: function symbol() constant returns(string)
  303. func (_KNWToken *KNWTokenCaller) Symbol(opts *bind.CallOpts) (string, error) {
  304. var (
  305. ret0 = new(string)
  306. )
  307. out := ret0
  308. err := _KNWToken.contract.Call(opts, out, "symbol")
  309. return *ret0, err
  310. }
  311. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
  312. //
  313. // Solidity: function symbol() constant returns(string)
  314. func (_KNWToken *KNWTokenSession) Symbol() (string, error) {
  315. return _KNWToken.Contract.Symbol(&_KNWToken.CallOpts)
  316. }
  317. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
  318. //
  319. // Solidity: function symbol() constant returns(string)
  320. func (_KNWToken *KNWTokenCallerSession) Symbol() (string, error) {
  321. return _KNWToken.Contract.Symbol(&_KNWToken.CallOpts)
  322. }
  323. // TotalLabelSupply is a free data retrieval call binding the contract method 0xc1a63f3c.
  324. //
  325. // Solidity: function totalLabelSupply(_label string) constant returns(uint256)
  326. func (_KNWToken *KNWTokenCaller) TotalLabelSupply(opts *bind.CallOpts, _label string) (*big.Int, error) {
  327. var (
  328. ret0 = new(*big.Int)
  329. )
  330. out := ret0
  331. err := _KNWToken.contract.Call(opts, out, "totalLabelSupply", _label)
  332. return *ret0, err
  333. }
  334. // TotalLabelSupply is a free data retrieval call binding the contract method 0xc1a63f3c.
  335. //
  336. // Solidity: function totalLabelSupply(_label string) constant returns(uint256)
  337. func (_KNWToken *KNWTokenSession) TotalLabelSupply(_label string) (*big.Int, error) {
  338. return _KNWToken.Contract.TotalLabelSupply(&_KNWToken.CallOpts, _label)
  339. }
  340. // TotalLabelSupply is a free data retrieval call binding the contract method 0xc1a63f3c.
  341. //
  342. // Solidity: function totalLabelSupply(_label string) constant returns(uint256)
  343. func (_KNWToken *KNWTokenCallerSession) TotalLabelSupply(_label string) (*big.Int, error) {
  344. return _KNWToken.Contract.TotalLabelSupply(&_KNWToken.CallOpts, _label)
  345. }
  346. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
  347. //
  348. // Solidity: function totalSupply() constant returns(uint256)
  349. func (_KNWToken *KNWTokenCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) {
  350. var (
  351. ret0 = new(*big.Int)
  352. )
  353. out := ret0
  354. err := _KNWToken.contract.Call(opts, out, "totalSupply")
  355. return *ret0, err
  356. }
  357. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
  358. //
  359. // Solidity: function totalSupply() constant returns(uint256)
  360. func (_KNWToken *KNWTokenSession) TotalSupply() (*big.Int, error) {
  361. return _KNWToken.Contract.TotalSupply(&_KNWToken.CallOpts)
  362. }
  363. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
  364. //
  365. // Solidity: function totalSupply() constant returns(uint256)
  366. func (_KNWToken *KNWTokenCallerSession) TotalSupply() (*big.Int, error) {
  367. return _KNWToken.Contract.TotalSupply(&_KNWToken.CallOpts)
  368. }
  369. // VotingAddress is a free data retrieval call binding the contract method 0xd2fa7170.
  370. //
  371. // Solidity: function votingAddress() constant returns(address)
  372. func (_KNWToken *KNWTokenCaller) VotingAddress(opts *bind.CallOpts) (common.Address, error) {
  373. var (
  374. ret0 = new(common.Address)
  375. )
  376. out := ret0
  377. err := _KNWToken.contract.Call(opts, out, "votingAddress")
  378. return *ret0, err
  379. }
  380. // VotingAddress is a free data retrieval call binding the contract method 0xd2fa7170.
  381. //
  382. // Solidity: function votingAddress() constant returns(address)
  383. func (_KNWToken *KNWTokenSession) VotingAddress() (common.Address, error) {
  384. return _KNWToken.Contract.VotingAddress(&_KNWToken.CallOpts)
  385. }
  386. // VotingAddress is a free data retrieval call binding the contract method 0xd2fa7170.
  387. //
  388. // Solidity: function votingAddress() constant returns(address)
  389. func (_KNWToken *KNWTokenCallerSession) VotingAddress() (common.Address, error) {
  390. return _KNWToken.Contract.VotingAddress(&_KNWToken.CallOpts)
  391. }
  392. // Burn is a paid mutator transaction binding the contract method 0x994dd93a.
  393. //
  394. // Solidity: function burn(_address address, _label string, _stakedTokens uint256, _winningPercentage uint256, _burningMethod uint256) returns()
  395. func (_KNWToken *KNWTokenTransactor) Burn(opts *bind.TransactOpts, _address common.Address, _label string, _stakedTokens *big.Int, _winningPercentage *big.Int, _burningMethod *big.Int) (*types.Transaction, error) {
  396. return _KNWToken.contract.Transact(opts, "burn", _address, _label, _stakedTokens, _winningPercentage, _burningMethod)
  397. }
  398. // Burn is a paid mutator transaction binding the contract method 0x994dd93a.
  399. //
  400. // Solidity: function burn(_address address, _label string, _stakedTokens uint256, _winningPercentage uint256, _burningMethod uint256) returns()
  401. func (_KNWToken *KNWTokenSession) Burn(_address common.Address, _label string, _stakedTokens *big.Int, _winningPercentage *big.Int, _burningMethod *big.Int) (*types.Transaction, error) {
  402. return _KNWToken.Contract.Burn(&_KNWToken.TransactOpts, _address, _label, _stakedTokens, _winningPercentage, _burningMethod)
  403. }
  404. // Burn is a paid mutator transaction binding the contract method 0x994dd93a.
  405. //
  406. // Solidity: function burn(_address address, _label string, _stakedTokens uint256, _winningPercentage uint256, _burningMethod uint256) returns()
  407. func (_KNWToken *KNWTokenTransactorSession) Burn(_address common.Address, _label string, _stakedTokens *big.Int, _winningPercentage *big.Int, _burningMethod *big.Int) (*types.Transaction, error) {
  408. return _KNWToken.Contract.Burn(&_KNWToken.TransactOpts, _address, _label, _stakedTokens, _winningPercentage, _burningMethod)
  409. }
  410. // LockTokens is a paid mutator transaction binding the contract method 0x1d3316d0.
  411. //
  412. // Solidity: function lockTokens(_address address, _label string) returns(numberOfTokens uint256)
  413. func (_KNWToken *KNWTokenTransactor) LockTokens(opts *bind.TransactOpts, _address common.Address, _label string) (*types.Transaction, error) {
  414. return _KNWToken.contract.Transact(opts, "lockTokens", _address, _label)
  415. }
  416. // LockTokens is a paid mutator transaction binding the contract method 0x1d3316d0.
  417. //
  418. // Solidity: function lockTokens(_address address, _label string) returns(numberOfTokens uint256)
  419. func (_KNWToken *KNWTokenSession) LockTokens(_address common.Address, _label string) (*types.Transaction, error) {
  420. return _KNWToken.Contract.LockTokens(&_KNWToken.TransactOpts, _address, _label)
  421. }
  422. // LockTokens is a paid mutator transaction binding the contract method 0x1d3316d0.
  423. //
  424. // Solidity: function lockTokens(_address address, _label string) returns(numberOfTokens uint256)
  425. func (_KNWToken *KNWTokenTransactorSession) LockTokens(_address common.Address, _label string) (*types.Transaction, error) {
  426. return _KNWToken.Contract.LockTokens(&_KNWToken.TransactOpts, _address, _label)
  427. }
  428. // Mint is a paid mutator transaction binding the contract method 0x4a5dc3aa.
  429. //
  430. // Solidity: function mint(_address address, _label string, _winningPercentage uint256, _mintingMethod uint256) returns()
  431. func (_KNWToken *KNWTokenTransactor) Mint(opts *bind.TransactOpts, _address common.Address, _label string, _winningPercentage *big.Int, _mintingMethod *big.Int) (*types.Transaction, error) {
  432. return _KNWToken.contract.Transact(opts, "mint", _address, _label, _winningPercentage, _mintingMethod)
  433. }
  434. // Mint is a paid mutator transaction binding the contract method 0x4a5dc3aa.
  435. //
  436. // Solidity: function mint(_address address, _label string, _winningPercentage uint256, _mintingMethod uint256) returns()
  437. func (_KNWToken *KNWTokenSession) Mint(_address common.Address, _label string, _winningPercentage *big.Int, _mintingMethod *big.Int) (*types.Transaction, error) {
  438. return _KNWToken.Contract.Mint(&_KNWToken.TransactOpts, _address, _label, _winningPercentage, _mintingMethod)
  439. }
  440. // Mint is a paid mutator transaction binding the contract method 0x4a5dc3aa.
  441. //
  442. // Solidity: function mint(_address address, _label string, _winningPercentage uint256, _mintingMethod uint256) returns()
  443. func (_KNWToken *KNWTokenTransactorSession) Mint(_address common.Address, _label string, _winningPercentage *big.Int, _mintingMethod *big.Int) (*types.Transaction, error) {
  444. return _KNWToken.Contract.Mint(&_KNWToken.TransactOpts, _address, _label, _winningPercentage, _mintingMethod)
  445. }
  446. // SetVotingAddress is a paid mutator transaction binding the contract method 0x7a6cfcab.
  447. //
  448. // Solidity: function setVotingAddress(_newVotingAddress address) returns()
  449. func (_KNWToken *KNWTokenTransactor) SetVotingAddress(opts *bind.TransactOpts, _newVotingAddress common.Address) (*types.Transaction, error) {
  450. return _KNWToken.contract.Transact(opts, "setVotingAddress", _newVotingAddress)
  451. }
  452. // SetVotingAddress is a paid mutator transaction binding the contract method 0x7a6cfcab.
  453. //
  454. // Solidity: function setVotingAddress(_newVotingAddress address) returns()
  455. func (_KNWToken *KNWTokenSession) SetVotingAddress(_newVotingAddress common.Address) (*types.Transaction, error) {
  456. return _KNWToken.Contract.SetVotingAddress(&_KNWToken.TransactOpts, _newVotingAddress)
  457. }
  458. // SetVotingAddress is a paid mutator transaction binding the contract method 0x7a6cfcab.
  459. //
  460. // Solidity: function setVotingAddress(_newVotingAddress address) returns()
  461. func (_KNWToken *KNWTokenTransactorSession) SetVotingAddress(_newVotingAddress common.Address) (*types.Transaction, error) {
  462. return _KNWToken.Contract.SetVotingAddress(&_KNWToken.TransactOpts, _newVotingAddress)
  463. }
  464. // UnlockTokens is a paid mutator transaction binding the contract method 0xd950df34.
  465. //
  466. // Solidity: function unlockTokens(_address address, _label string, _numberOfTokens uint256) returns()
  467. func (_KNWToken *KNWTokenTransactor) UnlockTokens(opts *bind.TransactOpts, _address common.Address, _label string, _numberOfTokens *big.Int) (*types.Transaction, error) {
  468. return _KNWToken.contract.Transact(opts, "unlockTokens", _address, _label, _numberOfTokens)
  469. }
  470. // UnlockTokens is a paid mutator transaction binding the contract method 0xd950df34.
  471. //
  472. // Solidity: function unlockTokens(_address address, _label string, _numberOfTokens uint256) returns()
  473. func (_KNWToken *KNWTokenSession) UnlockTokens(_address common.Address, _label string, _numberOfTokens *big.Int) (*types.Transaction, error) {
  474. return _KNWToken.Contract.UnlockTokens(&_KNWToken.TransactOpts, _address, _label, _numberOfTokens)
  475. }
  476. // UnlockTokens is a paid mutator transaction binding the contract method 0xd950df34.
  477. //
  478. // Solidity: function unlockTokens(_address address, _label string, _numberOfTokens uint256) returns()
  479. func (_KNWToken *KNWTokenTransactorSession) UnlockTokens(_address common.Address, _label string, _numberOfTokens *big.Int) (*types.Transaction, error) {
  480. return _KNWToken.Contract.UnlockTokens(&_KNWToken.TransactOpts, _address, _label, _numberOfTokens)
  481. }
  482. // KNWTokenBurnIterator is returned from FilterBurn and is used to iterate over the raw logs and unpacked data for Burn events raised by the KNWToken contract.
  483. type KNWTokenBurnIterator struct {
  484. Event *KNWTokenBurn // Event containing the contract specifics and raw log
  485. contract *bind.BoundContract // Generic contract to use for unpacking event data
  486. event string // Event name to use for unpacking event data
  487. logs chan types.Log // Log channel receiving the found contract events
  488. sub ethereum.Subscription // Subscription for errors, completion and termination
  489. done bool // Whether the subscription completed delivering logs
  490. fail error // Occurred error to stop iteration
  491. }
  492. // Next advances the iterator to the subsequent event, returning whether there
  493. // are any more events found. In case of a retrieval or parsing error, false is
  494. // returned and Error() can be queried for the exact failure.
  495. func (it *KNWTokenBurnIterator) Next() bool {
  496. // If the iterator failed, stop iterating
  497. if it.fail != nil {
  498. return false
  499. }
  500. // If the iterator completed, deliver directly whatever's available
  501. if it.done {
  502. select {
  503. case log := <-it.logs:
  504. it.Event = new(KNWTokenBurn)
  505. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  506. it.fail = err
  507. return false
  508. }
  509. it.Event.Raw = log
  510. return true
  511. default:
  512. return false
  513. }
  514. }
  515. // Iterator still in progress, wait for either a data or an error event
  516. select {
  517. case log := <-it.logs:
  518. it.Event = new(KNWTokenBurn)
  519. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  520. it.fail = err
  521. return false
  522. }
  523. it.Event.Raw = log
  524. return true
  525. case err := <-it.sub.Err():
  526. it.done = true
  527. it.fail = err
  528. return it.Next()
  529. }
  530. }
  531. // Error returns any retrieval or parsing error occurred during filtering.
  532. func (it *KNWTokenBurnIterator) Error() error {
  533. return it.fail
  534. }
  535. // Close terminates the iteration process, releasing any pending underlying
  536. // resources.
  537. func (it *KNWTokenBurnIterator) Close() error {
  538. it.sub.Unsubscribe()
  539. return nil
  540. }
  541. // KNWTokenBurn represents a Burn event raised by the KNWToken contract.
  542. type KNWTokenBurn struct {
  543. Who common.Address
  544. Label string
  545. Value *big.Int
  546. Raw types.Log // Blockchain specific contextual infos
  547. }
  548. // FilterBurn is a free log retrieval operation binding the contract event 0xfdf096248d2b7b0aef506231c043107c21faacc26193881b3f0cdc8b5479692a.
  549. //
  550. // Solidity: e Burn(who indexed address, label string, value uint256)
  551. func (_KNWToken *KNWTokenFilterer) FilterBurn(opts *bind.FilterOpts, who []common.Address) (*KNWTokenBurnIterator, error) {
  552. var whoRule []interface{}
  553. for _, whoItem := range who {
  554. whoRule = append(whoRule, whoItem)
  555. }
  556. logs, sub, err := _KNWToken.contract.FilterLogs(opts, "Burn", whoRule)
  557. if err != nil {
  558. return nil, err
  559. }
  560. return &KNWTokenBurnIterator{contract: _KNWToken.contract, event: "Burn", logs: logs, sub: sub}, nil
  561. }
  562. // WatchBurn is a free log subscription operation binding the contract event 0xfdf096248d2b7b0aef506231c043107c21faacc26193881b3f0cdc8b5479692a.
  563. //
  564. // Solidity: e Burn(who indexed address, label string, value uint256)
  565. func (_KNWToken *KNWTokenFilterer) WatchBurn(opts *bind.WatchOpts, sink chan<- *KNWTokenBurn, who []common.Address) (event.Subscription, error) {
  566. var whoRule []interface{}
  567. for _, whoItem := range who {
  568. whoRule = append(whoRule, whoItem)
  569. }
  570. logs, sub, err := _KNWToken.contract.WatchLogs(opts, "Burn", whoRule)
  571. if err != nil {
  572. return nil, err
  573. }
  574. return event.NewSubscription(func(quit <-chan struct{}) error {
  575. defer sub.Unsubscribe()
  576. for {
  577. select {
  578. case log := <-logs:
  579. // New log arrived, parse the event and forward to the user
  580. event := new(KNWTokenBurn)
  581. if err := _KNWToken.contract.UnpackLog(event, "Burn", log); err != nil {
  582. return err
  583. }
  584. event.Raw = log
  585. select {
  586. case sink <- event:
  587. case err := <-sub.Err():
  588. return err
  589. case <-quit:
  590. return nil
  591. }
  592. case err := <-sub.Err():
  593. return err
  594. case <-quit:
  595. return nil
  596. }
  597. }
  598. }), nil
  599. }
  600. // KNWTokenMintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the KNWToken contract.
  601. type KNWTokenMintIterator struct {
  602. Event *KNWTokenMint // Event containing the contract specifics and raw log
  603. contract *bind.BoundContract // Generic contract to use for unpacking event data
  604. event string // Event name to use for unpacking event data
  605. logs chan types.Log // Log channel receiving the found contract events
  606. sub ethereum.Subscription // Subscription for errors, completion and termination
  607. done bool // Whether the subscription completed delivering logs
  608. fail error // Occurred error to stop iteration
  609. }
  610. // Next advances the iterator to the subsequent event, returning whether there
  611. // are any more events found. In case of a retrieval or parsing error, false is
  612. // returned and Error() can be queried for the exact failure.
  613. func (it *KNWTokenMintIterator) Next() bool {
  614. // If the iterator failed, stop iterating
  615. if it.fail != nil {
  616. return false
  617. }
  618. // If the iterator completed, deliver directly whatever's available
  619. if it.done {
  620. select {
  621. case log := <-it.logs:
  622. it.Event = new(KNWTokenMint)
  623. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  624. it.fail = err
  625. return false
  626. }
  627. it.Event.Raw = log
  628. return true
  629. default:
  630. return false
  631. }
  632. }
  633. // Iterator still in progress, wait for either a data or an error event
  634. select {
  635. case log := <-it.logs:
  636. it.Event = new(KNWTokenMint)
  637. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  638. it.fail = err
  639. return false
  640. }
  641. it.Event.Raw = log
  642. return true
  643. case err := <-it.sub.Err():
  644. it.done = true
  645. it.fail = err
  646. return it.Next()
  647. }
  648. }
  649. // Error returns any retrieval or parsing error occurred during filtering.
  650. func (it *KNWTokenMintIterator) Error() error {
  651. return it.fail
  652. }
  653. // Close terminates the iteration process, releasing any pending underlying
  654. // resources.
  655. func (it *KNWTokenMintIterator) Close() error {
  656. it.sub.Unsubscribe()
  657. return nil
  658. }
  659. // KNWTokenMint represents a Mint event raised by the KNWToken contract.
  660. type KNWTokenMint struct {
  661. Who common.Address
  662. Label string
  663. Value *big.Int
  664. Raw types.Log // Blockchain specific contextual infos
  665. }
  666. // FilterMint is a free log retrieval operation binding the contract event 0xec4de1eef14af3ae5d77facf1ed7a9d3d50f6285573ee0ec155fc11217fc3442.
  667. //
  668. // Solidity: e Mint(who indexed address, label string, value uint256)
  669. func (_KNWToken *KNWTokenFilterer) FilterMint(opts *bind.FilterOpts, who []common.Address) (*KNWTokenMintIterator, error) {
  670. var whoRule []interface{}
  671. for _, whoItem := range who {
  672. whoRule = append(whoRule, whoItem)
  673. }
  674. logs, sub, err := _KNWToken.contract.FilterLogs(opts, "Mint", whoRule)
  675. if err != nil {
  676. return nil, err
  677. }
  678. return &KNWTokenMintIterator{contract: _KNWToken.contract, event: "Mint", logs: logs, sub: sub}, nil
  679. }
  680. // WatchMint is a free log subscription operation binding the contract event 0xec4de1eef14af3ae5d77facf1ed7a9d3d50f6285573ee0ec155fc11217fc3442.
  681. //
  682. // Solidity: e Mint(who indexed address, label string, value uint256)
  683. func (_KNWToken *KNWTokenFilterer) WatchMint(opts *bind.WatchOpts, sink chan<- *KNWTokenMint, who []common.Address) (event.Subscription, error) {
  684. var whoRule []interface{}
  685. for _, whoItem := range who {
  686. whoRule = append(whoRule, whoItem)
  687. }
  688. logs, sub, err := _KNWToken.contract.WatchLogs(opts, "Mint", whoRule)
  689. if err != nil {
  690. return nil, err
  691. }
  692. return event.NewSubscription(func(quit <-chan struct{}) error {
  693. defer sub.Unsubscribe()
  694. for {
  695. select {
  696. case log := <-logs:
  697. // New log arrived, parse the event and forward to the user
  698. event := new(KNWTokenMint)
  699. if err := _KNWToken.contract.UnpackLog(event, "Mint", log); err != nil {
  700. return err
  701. }
  702. event.Raw = log
  703. select {
  704. case sink <- event:
  705. case err := <-sub.Err():
  706. return err
  707. case <-quit:
  708. return nil
  709. }
  710. case err := <-sub.Err():
  711. return err
  712. case <-quit:
  713. return nil
  714. }
  715. }
  716. }), nil
  717. }
  718. // SafeMathABI is the input ABI used to generate the binding from.
  719. const SafeMathABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"a\",\"type\":\"uint256\"}],\"name\":\"sqrt\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}]"
  720. // SafeMathBin is the compiled bytecode used for deploying new contracts.
  721. const SafeMathBin = `0x61016b610030600b82828239805160001a6073146000811461002057610022565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600436106100575763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663677342ce811461005c575b600080fd5b610067600435610079565b60408051918252519081900360200190f35b6000808083151561008d5760009250610138565b6001840184106100fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f466c6177656420696e70757420666f7220737172740000000000000000000000604482015290519081900360640190fd5b505060026001830104825b80821015610134575080600281808681151561012157fe5b040181151561012c57fe5b049150610109565b8192505b50509190505600a165627a7a72305820ce9eba5c2c770e6489e8634ca0a14db23dee696aa56e1247aac6317c7eab01bd0029`
  722. // DeploySafeMath deploys a new Ethereum contract, binding an instance of SafeMath to it.
  723. func DeploySafeMath(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SafeMath, error) {
  724. parsed, err := abi.JSON(strings.NewReader(SafeMathABI))
  725. if err != nil {
  726. return common.Address{}, nil, nil, err
  727. }
  728. address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(SafeMathBin), backend)
  729. if err != nil {
  730. return common.Address{}, nil, nil, err
  731. }
  732. return address, tx, &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil
  733. }
  734. // SafeMath is an auto generated Go binding around an Ethereum contract.
  735. type SafeMath struct {
  736. SafeMathCaller // Read-only binding to the contract
  737. SafeMathTransactor // Write-only binding to the contract
  738. SafeMathFilterer // Log filterer for contract events
  739. }
  740. // SafeMathCaller is an auto generated read-only Go binding around an Ethereum contract.
  741. type SafeMathCaller struct {
  742. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  743. }
  744. // SafeMathTransactor is an auto generated write-only Go binding around an Ethereum contract.
  745. type SafeMathTransactor struct {
  746. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  747. }
  748. // SafeMathFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
  749. type SafeMathFilterer struct {
  750. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  751. }
  752. // SafeMathSession is an auto generated Go binding around an Ethereum contract,
  753. // with pre-set call and transact options.
  754. type SafeMathSession struct {
  755. Contract *SafeMath // Generic contract binding to set the session for
  756. CallOpts bind.CallOpts // Call options to use throughout this session
  757. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  758. }
  759. // SafeMathCallerSession is an auto generated read-only Go binding around an Ethereum contract,
  760. // with pre-set call options.
  761. type SafeMathCallerSession struct {
  762. Contract *SafeMathCaller // Generic contract caller binding to set the session for
  763. CallOpts bind.CallOpts // Call options to use throughout this session
  764. }
  765. // SafeMathTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
  766. // with pre-set transact options.
  767. type SafeMathTransactorSession struct {
  768. Contract *SafeMathTransactor // Generic contract transactor binding to set the session for
  769. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  770. }
  771. // SafeMathRaw is an auto generated low-level Go binding around an Ethereum contract.
  772. type SafeMathRaw struct {
  773. Contract *SafeMath // Generic contract binding to access the raw methods on
  774. }
  775. // SafeMathCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
  776. type SafeMathCallerRaw struct {
  777. Contract *SafeMathCaller // Generic read-only contract binding to access the raw methods on
  778. }
  779. // SafeMathTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
  780. type SafeMathTransactorRaw struct {
  781. Contract *SafeMathTransactor // Generic write-only contract binding to access the raw methods on
  782. }
  783. // NewSafeMath creates a new instance of SafeMath, bound to a specific deployed contract.
  784. func NewSafeMath(address common.Address, backend bind.ContractBackend) (*SafeMath, error) {
  785. contract, err := bindSafeMath(address, backend, backend, backend)
  786. if err != nil {
  787. return nil, err
  788. }
  789. return &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil
  790. }
  791. // NewSafeMathCaller creates a new read-only instance of SafeMath, bound to a specific deployed contract.
  792. func NewSafeMathCaller(address common.Address, caller bind.ContractCaller) (*SafeMathCaller, error) {
  793. contract, err := bindSafeMath(address, caller, nil, nil)
  794. if err != nil {
  795. return nil, err
  796. }
  797. return &SafeMathCaller{contract: contract}, nil
  798. }
  799. // NewSafeMathTransactor creates a new write-only instance of SafeMath, bound to a specific deployed contract.
  800. func NewSafeMathTransactor(address common.Address, transactor bind.ContractTransactor) (*SafeMathTransactor, error) {
  801. contract, err := bindSafeMath(address, nil, transactor, nil)
  802. if err != nil {
  803. return nil, err
  804. }
  805. return &SafeMathTransactor{contract: contract}, nil
  806. }
  807. // NewSafeMathFilterer creates a new log filterer instance of SafeMath, bound to a specific deployed contract.
  808. func NewSafeMathFilterer(address common.Address, filterer bind.ContractFilterer) (*SafeMathFilterer, error) {
  809. contract, err := bindSafeMath(address, nil, nil, filterer)
  810. if err != nil {
  811. return nil, err
  812. }
  813. return &SafeMathFilterer{contract: contract}, nil
  814. }
  815. // bindSafeMath binds a generic wrapper to an already deployed contract.
  816. func bindSafeMath(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
  817. parsed, err := abi.JSON(strings.NewReader(SafeMathABI))
  818. if err != nil {
  819. return nil, err
  820. }
  821. return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
  822. }
  823. // Call invokes the (constant) contract method with params as input values and
  824. // sets the output to result. The result type might be a single field for simple
  825. // returns, a slice of interfaces for anonymous returns and a struct for named
  826. // returns.
  827. func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  828. return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...)
  829. }
  830. // Transfer initiates a plain transaction to move funds to the contract, calling
  831. // its default method if one is available.
  832. func (_SafeMath *SafeMathRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  833. return _SafeMath.Contract.SafeMathTransactor.contract.Transfer(opts)
  834. }
  835. // Transact invokes the (paid) contract method with params as input values.
  836. func (_SafeMath *SafeMathRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  837. return _SafeMath.Contract.SafeMathTransactor.contract.Transact(opts, method, params...)
  838. }
  839. // Call invokes the (constant) contract method with params as input values and
  840. // sets the output to result. The result type might be a single field for simple
  841. // returns, a slice of interfaces for anonymous returns and a struct for named
  842. // returns.
  843. func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  844. return _SafeMath.Contract.contract.Call(opts, result, method, params...)
  845. }
  846. // Transfer initiates a plain transaction to move funds to the contract, calling
  847. // its default method if one is available.
  848. func (_SafeMath *SafeMathTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  849. return _SafeMath.Contract.contract.Transfer(opts)
  850. }
  851. // Transact invokes the (paid) contract method with params as input values.
  852. func (_SafeMath *SafeMathTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  853. return _SafeMath.Contract.contract.Transact(opts, method, params...)
  854. }
  855. // Sqrt is a free data retrieval call binding the contract method 0x677342ce.
  856. //
  857. // Solidity: function sqrt(a uint256) constant returns(uint256)
  858. func (_SafeMath *SafeMathCaller) Sqrt(opts *bind.CallOpts, a *big.Int) (*big.Int, error) {
  859. var (
  860. ret0 = new(*big.Int)
  861. )
  862. out := ret0
  863. err := _SafeMath.contract.Call(opts, out, "sqrt", a)
  864. return *ret0, err
  865. }
  866. // Sqrt is a free data retrieval call binding the contract method 0x677342ce.
  867. //
  868. // Solidity: function sqrt(a uint256) constant returns(uint256)
  869. func (_SafeMath *SafeMathSession) Sqrt(a *big.Int) (*big.Int, error) {
  870. return _SafeMath.Contract.Sqrt(&_SafeMath.CallOpts, a)
  871. }
  872. // Sqrt is a free data retrieval call binding the contract method 0x677342ce.
  873. //
  874. // Solidity: function sqrt(a uint256) constant returns(uint256)
  875. func (_SafeMath *SafeMathCallerSession) Sqrt(a *big.Int) (*big.Int, error) {
  876. return _SafeMath.Contract.Sqrt(&_SafeMath.CallOpts, a)
  877. }