|
|
|
@ -28,10 +28,10 @@ var ( |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
// PuzzleABI is the input ABI used to generate the binding from.
|
|
|
|
|
const PuzzleABI = "[{\"constant\":false,\"inputs\":[{\"name\":\"player\",\"type\":\"address\"}],\"name\":\"endGame\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"player\",\"type\":\"address\"},{\"name\":\"level\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"string\"}],\"name\":\"payout\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"player\",\"type\":\"address\"},{\"name\":\"level\",\"type\":\"uint256\"}],\"name\":\"setLevel\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getPlayers\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"play\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"player\",\"type\":\"address\"}],\"name\":\"resetPlayer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"reset\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"players\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}]" |
|
|
|
|
const PuzzleABI = "[{\"constant\":false,\"inputs\":[{\"name\":\"player\",\"type\":\"address\"}],\"name\":\"endGame\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"player\",\"type\":\"address\"},{\"name\":\"level\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"string\"}],\"name\":\"payout\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"player\",\"type\":\"address\"},{\"name\":\"level\",\"type\":\"uint256\"}],\"name\":\"setLevel\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getPlayers\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"play\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"player\",\"type\":\"address\"}],\"name\":\"resetPlayer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"reset\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"players\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"constructor\"}]" |
|
|
|
|
|
|
|
|
|
// PuzzleBin is the compiled bytecode used for deploying new contracts.
|
|
|
|
|
const PuzzleBin = `0x608060405234801561001057600080fd5b50600480546001600160a01b0319163317905561096d806100326000396000f3fe6080604052600436106100865760003560e01c80638b5b9ccc116100595780638b5b9ccc146101e557806393e84cd91461024a578063c95e090914610252578063d826f88f14610285578063f71d96cb1461029a57610086565b80632a035b6c1461008b578063481c6a75146100c057806352bcd7c8146100f1578063722dcd8f146101ac575b600080fd5b34801561009757600080fd5b506100be600480360360208110156100ae57600080fd5b50356001600160a01b03166102c4565b005b3480156100cc57600080fd5b506100d56103ad565b604080516001600160a01b039092168252519081900360200190f35b6100be6004803603606081101561010757600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561013757600080fd5b82018360208201111561014957600080fd5b8035906020019184600183028401116401000000008311171561016b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506103bc945050505050565b3480156101b857600080fd5b506100be600480360360408110156101cf57600080fd5b506001600160a01b038135169060200135610567565b3480156101f157600080fd5b506101fa610583565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561023657818101518382015260200161021e565b505050509050019250505060405180910390f35b6100be6105e6565b34801561025e57600080fd5b506100be6004803603602081101561027557600080fd5b50356001600160a01b031661071d565b34801561029157600080fd5b506100be6107f0565b3480156102a657600080fd5b506100d5600480360360208110156102bd57600080fd5b50356108d3565b6004546040805180820190915260138152600160681b72556e617574686f72697a656420416363657373026020820152906001600160a01b0316331461038b57604051600160e51b62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610350578181015183820152602001610338565b50505050905090810190601f16801561037d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506001600160a01b03166000908152600260205260409020805460ff19169055565b6004546001600160a01b031681565b6004546040805180820190915260138152600160681b72556e617574686f72697a656420416363657373026020820152906001600160a01b0316331461044657604051600160e51b62461bcd028152602060048201818152835160248401528351909283926044909101919085019080838360008315610350578181015183820152602001610338565b506001600160a01b038316600090815260026020908152604091829020548251808401909352601f83527f506c61796572206973206e6f7420696e20616e206163746976652067616d65009183019190915260ff1615156001146104ee57604051600160e51b62461bcd028152602060048201818152835160248401528351909283926044909101919085019080838360008315610350578181015183820152602001610338565b506001600160a01b03831660009081526020819052604090205482036105148484610567565b6001600160a01b03841660008181526001602052604080822054905160059091048402929183156108fc02918491818181858888f1935050505015801561055f573d6000803e3d6000fd5b505050505050565b6001600160a01b03909116600090815260208190526040902055565b606060058054806020026020016040519081016040528092919081815260200182805480156105db57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116105bd575b505050505090505b90565b60408051808201909152601181527f496e73756666696369656e742046756e6400000000000000000000000000000060208201526801158e460913d0000034101561067557604051600160e51b62461bcd028152602060048201818152835160248401528351909283926044909101919085019080838360008315610350578181015183820152602001610338565b503360009081526003602052604090205460ff166106ea57336000818152600360205260408120805460ff191660019081179091556005805491820181559091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b03191690911790555b3360009081526020818152604080832083905560018083528184203490556002909252909120805460ff19169091179055565b6004546040805180820190915260138152600160681b72556e617574686f72697a656420416363657373026020820152906001600160a01b031633146107a757604051600160e51b62461bcd028152602060048201818152835160248401528351909283926044909101919085019080838360008315610350578181015183820152602001610338565b506001600160a01b031660009081526020818152604080832083905560028252808320805460ff1990811690915560018352818420849055600390925290912080549091169055565b6004546040805180820190915260138152600160681b72556e617574686f72697a656420416363657373026020820152906001600160a01b0316331461087a57604051600160e51b62461bcd028152602060048201818152835160248401528351909283926044909101919085019080838360008315610350578181015183820152602001610338565b5060055460005b818110156108c15760006005828154811061089857fe5b6000918252602090912001546001600160a01b031690506108b88161071d565b50600101610881565b5060006108cf6005826108fa565b5050565b600581815481106108e057fe5b6000918252602090912001546001600160a01b0316905081565b81548183558181111561091e5760008381526020902061091e918101908301610923565b505050565b6105e391905b8082111561093d5760008155600101610929565b509056fea165627a7a7230582062a9296ff3394d1dc60def0222978a34a1ef4444a5fcee620e83cc345fd292660029` |
|
|
|
|
const PuzzleBin = `0x6080604052600480546001600160a01b03191633179055610984806100256000396000f3fe6080604052600436106100865760003560e01c80638b5b9ccc116100595780638b5b9ccc146101f257806393e84cd914610257578063c95e09091461025f578063d826f88f14610292578063f71d96cb146102a757610086565b80632a035b6c1461008b578063481c6a75146100c057806352bcd7c8146100f1578063722dcd8f146101b9575b600080fd5b34801561009757600080fd5b506100be600480360360208110156100ae57600080fd5b50356001600160a01b03166102d1565b005b3480156100cc57600080fd5b506100d56103ba565b604080516001600160a01b039092168252519081900360200190f35b3480156100fd57600080fd5b506100be6004803603606081101561011457600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561014457600080fd5b82018360208201111561015657600080fd5b8035906020019184600183028401116401000000008311171561017857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506103c9945050505050565b3480156101c557600080fd5b506100be600480360360408110156101dc57600080fd5b506001600160a01b038135169060200135610576565b3480156101fe57600080fd5b50610207610592565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561024357818101518382015260200161022b565b505050509050019250505060405180910390f35b6100be6105f5565b34801561026b57600080fd5b506100be6004803603602081101561028257600080fd5b50356001600160a01b031661072f565b34801561029e57600080fd5b506100be610803565b3480156102b357600080fd5b506100d5600480360360208110156102ca57600080fd5b50356108e9565b6004546040805180820190915260138152600160681b72556e617574686f72697a656420416363657373026020820152906001600160a01b0316331461039857604051600160e51b62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561035d578181015183820152602001610345565b50505050905090810190601f16801561038a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506001600160a01b03166000908152600260205260409020805460ff19169055565b6004546001600160a01b031681565b6004546040805180820190915260138152600160681b72556e617574686f72697a656420416363657373026020820152906001600160a01b0316331461045457604051600160e51b62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360008381101561035d578181015183820152602001610345565b506001600160a01b038316600090815260026020908152604091829020548251808401909352601f83527f506c61796572206973206e6f7420696e20616e206163746976652067616d65009183019190915260ff1615156001146104fd57604051600160e51b62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360008381101561035d578181015183820152602001610345565b506001600160a01b03831660009081526020819052604090205482036105238484610576565b6001600160a01b03841660008181526001602052604080822054905160059091048402929183156108fc02918491818181858888f1935050505015801561056e573d6000803e3d6000fd5b505050505050565b6001600160a01b03909116600090815260208190526040902055565b606060058054806020026020016040519081016040528092919081815260200182805480156105ea57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116105cc575b505050505090505b90565b60408051808201909152601181527f496e73756666696369656e742046756e6400000000000000000000000000000060208201526801158e460913d0000034101561068557604051600160e51b62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360008381101561035d578181015183820152602001610345565b503360009081526003602052604090205460ff1615156106fc57336000818152600360205260408120805460ff191660019081179091556005805491820181559091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b03191690911790555b3360009081526020818152604080832083905560018083528184203490556002909252909120805460ff19169091179055565b6004546040805180820190915260138152600160681b72556e617574686f72697a656420416363657373026020820152906001600160a01b031633146107ba57604051600160e51b62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360008381101561035d578181015183820152602001610345565b506001600160a01b031660009081526020818152604080832083905560028252808320805460ff1990811690915560018352818420849055600390925290912080549091169055565b6004546040805180820190915260138152600160681b72556e617574686f72697a656420416363657373026020820152906001600160a01b0316331461088e57604051600160e51b62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360008381101561035d578181015183820152602001610345565b5060055460005b818110156108d75760006005828154811015156108ae57fe5b6000918252602090912001546001600160a01b031690506108ce8161072f565b50600101610895565b5060006108e5600582610911565b5050565b60058054829081106108f757fe5b6000918252602090912001546001600160a01b0316905081565b8154818355818111156109355760008381526020902061093591810190830161093a565b505050565b6105f291905b808211156109545760008155600101610940565b509056fea165627a7a723058204706efee8388d70aabafd388a42b5b54a6268e521a1d1401aec9adf14b0e6f980029` |
|
|
|
|
|
|
|
|
|
// DeployPuzzle deploys a new Ethereum contract, binding an instance of Puzzle to it.
|
|
|
|
|
func DeployPuzzle(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Puzzle, error) { |
|
|
|
@ -268,42 +268,42 @@ func (_Puzzle *PuzzleCallerSession) Players(arg0 *big.Int) (common.Address, erro |
|
|
|
|
|
|
|
|
|
// EndGame is a paid mutator transaction binding the contract method 0x2a035b6c.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function endGame(player address) returns()
|
|
|
|
|
// Solidity: function endGame(address player) returns()
|
|
|
|
|
func (_Puzzle *PuzzleTransactor) EndGame(opts *bind.TransactOpts, player common.Address) (*types.Transaction, error) { |
|
|
|
|
return _Puzzle.contract.Transact(opts, "endGame", player) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// EndGame is a paid mutator transaction binding the contract method 0x2a035b6c.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function endGame(player address) returns()
|
|
|
|
|
// Solidity: function endGame(address player) returns()
|
|
|
|
|
func (_Puzzle *PuzzleSession) EndGame(player common.Address) (*types.Transaction, error) { |
|
|
|
|
return _Puzzle.Contract.EndGame(&_Puzzle.TransactOpts, player) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// EndGame is a paid mutator transaction binding the contract method 0x2a035b6c.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function endGame(player address) returns()
|
|
|
|
|
// Solidity: function endGame(address player) returns()
|
|
|
|
|
func (_Puzzle *PuzzleTransactorSession) EndGame(player common.Address) (*types.Transaction, error) { |
|
|
|
|
return _Puzzle.Contract.EndGame(&_Puzzle.TransactOpts, player) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Payout is a paid mutator transaction binding the contract method 0x52bcd7c8.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function payout(player address, level uint256, string) returns()
|
|
|
|
|
// Solidity: function payout(address player, uint256 level, string ) returns()
|
|
|
|
|
func (_Puzzle *PuzzleTransactor) Payout(opts *bind.TransactOpts, player common.Address, level *big.Int, arg2 string) (*types.Transaction, error) { |
|
|
|
|
return _Puzzle.contract.Transact(opts, "payout", player, level, arg2) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Payout is a paid mutator transaction binding the contract method 0x52bcd7c8.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function payout(player address, level uint256, string) returns()
|
|
|
|
|
// Solidity: function payout(address player, uint256 level, string ) returns()
|
|
|
|
|
func (_Puzzle *PuzzleSession) Payout(player common.Address, level *big.Int, arg2 string) (*types.Transaction, error) { |
|
|
|
|
return _Puzzle.Contract.Payout(&_Puzzle.TransactOpts, player, level, arg2) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Payout is a paid mutator transaction binding the contract method 0x52bcd7c8.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function payout(player address, level uint256, string) returns()
|
|
|
|
|
// Solidity: function payout(address player, uint256 level, string ) returns()
|
|
|
|
|
func (_Puzzle *PuzzleTransactorSession) Payout(player common.Address, level *big.Int, arg2 string) (*types.Transaction, error) { |
|
|
|
|
return _Puzzle.Contract.Payout(&_Puzzle.TransactOpts, player, level, arg2) |
|
|
|
|
} |
|
|
|
@ -352,42 +352,42 @@ func (_Puzzle *PuzzleTransactorSession) Reset() (*types.Transaction, error) { |
|
|
|
|
|
|
|
|
|
// ResetPlayer is a paid mutator transaction binding the contract method 0xc95e0909.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function resetPlayer(player address) returns()
|
|
|
|
|
// Solidity: function resetPlayer(address player) returns()
|
|
|
|
|
func (_Puzzle *PuzzleTransactor) ResetPlayer(opts *bind.TransactOpts, player common.Address) (*types.Transaction, error) { |
|
|
|
|
return _Puzzle.contract.Transact(opts, "resetPlayer", player) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ResetPlayer is a paid mutator transaction binding the contract method 0xc95e0909.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function resetPlayer(player address) returns()
|
|
|
|
|
// Solidity: function resetPlayer(address player) returns()
|
|
|
|
|
func (_Puzzle *PuzzleSession) ResetPlayer(player common.Address) (*types.Transaction, error) { |
|
|
|
|
return _Puzzle.Contract.ResetPlayer(&_Puzzle.TransactOpts, player) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ResetPlayer is a paid mutator transaction binding the contract method 0xc95e0909.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function resetPlayer(player address) returns()
|
|
|
|
|
// Solidity: function resetPlayer(address player) returns()
|
|
|
|
|
func (_Puzzle *PuzzleTransactorSession) ResetPlayer(player common.Address) (*types.Transaction, error) { |
|
|
|
|
return _Puzzle.Contract.ResetPlayer(&_Puzzle.TransactOpts, player) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// SetLevel is a paid mutator transaction binding the contract method 0x722dcd8f.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function setLevel(player address, level uint256) returns()
|
|
|
|
|
// Solidity: function setLevel(address player, uint256 level) returns()
|
|
|
|
|
func (_Puzzle *PuzzleTransactor) SetLevel(opts *bind.TransactOpts, player common.Address, level *big.Int) (*types.Transaction, error) { |
|
|
|
|
return _Puzzle.contract.Transact(opts, "setLevel", player, level) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// SetLevel is a paid mutator transaction binding the contract method 0x722dcd8f.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function setLevel(player address, level uint256) returns()
|
|
|
|
|
// Solidity: function setLevel(address player, uint256 level) returns()
|
|
|
|
|
func (_Puzzle *PuzzleSession) SetLevel(player common.Address, level *big.Int) (*types.Transaction, error) { |
|
|
|
|
return _Puzzle.Contract.SetLevel(&_Puzzle.TransactOpts, player, level) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// SetLevel is a paid mutator transaction binding the contract method 0x722dcd8f.
|
|
|
|
|
//
|
|
|
|
|
// Solidity: function setLevel(player address, level uint256) returns()
|
|
|
|
|
// Solidity: function setLevel(address player, uint256 level) returns()
|
|
|
|
|
func (_Puzzle *PuzzleTransactorSession) SetLevel(player common.Address, level *big.Int) (*types.Transaction, error) { |
|
|
|
|
return _Puzzle.Contract.SetLevel(&_Puzzle.TransactOpts, player, level) |
|
|
|
|
} |
|
|
|
|