diff --git a/contracts/validator/contract/TomoValidator.sol b/contracts/validator/contract/TomoValidator.sol index 49668cbba6..6364666753 100644 --- a/contracts/validator/contract/TomoValidator.sol +++ b/contracts/validator/contract/TomoValidator.sol @@ -8,13 +8,13 @@ contract TomoValidator is IValidator { event Vote(address _voter, address _candidate, uint256 _cap); event Unvote(address _voter, address _candidate, uint256 _cap); - event Propose(address _backer, address _candidate, uint256 _cap); - event Resign(address _backer, address _candidate); - event SetNodeUrl(address _backer, address _candidate, string _nodeUrl); - event Withdraw(address _backer, address _candidate, uint256 _cap); + event Propose(address _owner, address _candidate, uint256 _cap); + event Resign(address _owner, address _candidate); + event SetNodeUrl(address _owner, address _candidate, string _nodeUrl); + event Withdraw(address _owner, address _candidate, uint256 _cap); struct ValidatorState { - address backer; + address owner; string nodeUrl; bool isCandidate; uint256 cap; @@ -28,15 +28,16 @@ contract TomoValidator is IValidator { uint256 candidateCount = 0; uint256 public constant minCandidateCap = 50000 ether; uint256 public constant maxValidatorNumber = 99; + uint256 public constant candidateWithdrawDelay = 100; // blocks modifier onlyValidCandidateCap { - // anyone can deposit 10000 TOMO to become a candidate + // anyone can deposit X TOMO to become a candidate require(msg.value >= minCandidateCap); _; } - modifier onlyBacker(address _candidate) { - require(validatorsState[_candidate].backer == msg.sender); + modifier onlyOwner(address _candidate) { + require(validatorsState[_candidate].owner == msg.sender); _; } @@ -71,7 +72,7 @@ contract TomoValidator is IValidator { for (uint256 i = 0; i < _candidates.length; i++) { validatorsState[_candidates[i]] = ValidatorState({ - backer: msg.sender, + owner: msg.sender, nodeUrl: '', isCandidate: true, withdrawBlockNumber: 0, @@ -85,7 +86,7 @@ contract TomoValidator is IValidator { function propose(address _candidate, string _nodeUrl) external payable onlyValidCandidateCap onlyNotCandidate(_candidate) { candidates.push(_candidate); validatorsState[_candidate] = ValidatorState({ - backer: msg.sender, + owner: msg.sender, nodeUrl: _nodeUrl, isCandidate: true, withdrawBlockNumber: 0, @@ -117,8 +118,8 @@ contract TomoValidator is IValidator { return validatorsState[_candidate].nodeUrl; } - function getCandidateBacker(address _candidate) public view returns(address) { - return validatorsState[_candidate].backer; + function getCandidateOwner(address _candidate) public view returns(address) { + return validatorsState[_candidate].owner; } function getCandidateWithdrawBlockNumber(address _candidate) public view returns(uint256) { @@ -145,12 +146,12 @@ contract TomoValidator is IValidator { emit Unvote(msg.sender, _candidate, _cap); } - function setNodeUrl(address _candidate, string _nodeUrl) public onlyBacker(_candidate) { + function setNodeUrl(address _candidate, string _nodeUrl) public onlyOwner(_candidate) { validatorsState[_candidate].nodeUrl = _nodeUrl; emit SetNodeUrl(msg.sender, _candidate, _nodeUrl); } - function resign(address _candidate) public onlyBacker(_candidate) onlyCandidate(_candidate) { + function resign(address _candidate) public onlyOwner(_candidate) onlyCandidate(_candidate) { validatorsState[_candidate].isCandidate = false; candidateCount = candidateCount - 1; for (uint256 i = 0; i < candidates.length; i++) { @@ -159,12 +160,12 @@ contract TomoValidator is IValidator { break; } } - // refunding after retiring 100 blocks - validatorsState[_candidate].withdrawBlockNumber = validatorsState[_candidate].withdrawBlockNumber.add(block.number).add(100); + // refunding after retiring X blocks + validatorsState[_candidate].withdrawBlockNumber = validatorsState[_candidate].withdrawBlockNumber.add(block.number).add(candidateWithdrawDelay); emit Resign(msg.sender, _candidate); } - function withdraw(address _candidate) public onlyBacker(_candidate) onlyNotCandidate(_candidate) onlyAlreadyResigned(_candidate) { + function withdraw(address _candidate) public onlyOwner(_candidate) onlyNotCandidate(_candidate) onlyAlreadyResigned(_candidate) { uint256 cap = validatorsState[_candidate].voters[msg.sender]; validatorsState[_candidate].cap = validatorsState[_candidate].cap.sub(cap); validatorsState[_candidate].voters[msg.sender] = 0; diff --git a/contracts/validator/contract/validator.go b/contracts/validator/contract/validator.go index 834fec6ce5..cc848dd469 100644 --- a/contracts/validator/contract/validator.go +++ b/contracts/validator/contract/validator.go @@ -380,10 +380,10 @@ func (_SafeMath *SafeMathTransactorRaw) Transact(opts *bind.TransactOpts, method } // TomoValidatorABI is the input ABI used to generate the binding from. -const TomoValidatorABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getCandidateBacker\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"},{\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"unvote\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCandidates\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getCandidateWithdrawBlockNumber\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getVoters\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"},{\"name\":\"_voter\",\"type\":\"address\"}],\"name\":\"getVoterCap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"candidates\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getCandidateCap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"vote\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"},{\"name\":\"_nodeUrl\",\"type\":\"string\"}],\"name\":\"setNodeUrl\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"resign\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"maxValidatorNumber\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"isCandidate\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"minCandidateCap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"},{\"name\":\"_nodeUrl\",\"type\":\"string\"}],\"name\":\"propose\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getCandidateNodeUrl\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_candidates\",\"type\":\"address[]\"},{\"name\":\"_caps\",\"type\":\"uint256[]\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_voter\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"Vote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_voter\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"Unvote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_backer\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"Propose\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_backer\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"Resign\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_backer\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_nodeUrl\",\"type\":\"string\"}],\"name\":\"SetNodeUrl\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_backer\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"}]" +const TomoValidatorABI = "[{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"},{\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"unvote\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCandidates\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getCandidateWithdrawBlockNumber\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getVoters\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"},{\"name\":\"_voter\",\"type\":\"address\"}],\"name\":\"getVoterCap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"candidates\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getCandidateCap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"vote\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"},{\"name\":\"_nodeUrl\",\"type\":\"string\"}],\"name\":\"setNodeUrl\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"resign\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getCandidateOwner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"maxValidatorNumber\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"candidateWithdrawDelay\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"isCandidate\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"minCandidateCap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"},{\"name\":\"_nodeUrl\",\"type\":\"string\"}],\"name\":\"propose\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getCandidateNodeUrl\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_candidates\",\"type\":\"address[]\"},{\"name\":\"_caps\",\"type\":\"uint256[]\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_voter\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"Vote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_voter\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"Unvote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"Propose\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"Resign\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_nodeUrl\",\"type\":\"string\"}],\"name\":\"SetNodeUrl\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"}]" // TomoValidatorBin is the compiled bytecode used for deploying new contracts. -const TomoValidatorBin = `0x6060604052600060035534156200001557600080fd5b6040516200142838038062001428833981016040528080518201919060200180519091019050600060028380516200005292916020019062000171565b50600090505b8251811015620001685760a06040519081016040528033600160a060020a0316815260200160206040519081016040908152600082529082526001602083015201838381518110620000a657fe5b9060200190602002015181526020016000815250600080858481518110620000ca57fe5b90602001906020020151600160a060020a03168152602081019190915260400160002081518154600160a060020a031916600160a060020a039190911617815560208201518160010190805162000126929160200190620001dd565b50604082015160028201805460ff1916911515919091179055606082015181600301556080820151600490910155506003805460019081019091550162000058565b505050620002a5565b828054828255906000526020600020908101928215620001cb579160200282015b82811115620001cb5782518254600160a060020a031916600160a060020a03919091161782556020929092019160019091019062000192565b50620001d99291506200025e565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200022057805160ff191683800117855562000250565b8280016001018555821562000250579182015b828111156200025057825182559160200191906001019062000233565b50620001d992915062000288565b6200028591905b80821115620001d9578054600160a060020a031916815560010162000265565b90565b6200028591905b80821115620001d957600081556001016200028f565b61117380620002b56000396000f3006060604052600436106100ef5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662a9550181146100f457806302aa9be21461012f57806306a49fce1461015357806328265294146101b95780632d15cc04146101ea578063302b6872146102095780633477ee2e1461022e57806351cff8d91461024457806358e7525f146102635780636dd7d8ea14610282578063a3ec796514610296578063ae6e43f5146102f5578063d09f1ab414610314578063d51b9e9314610327578063d55b7dff1461035a578063d6f0948c1461036d578063da67b5991461038d575b600080fd5b34156100ff57600080fd5b610113600160a060020a0360043516610423565b604051600160a060020a03909116815260200160405180910390f35b341561013a57600080fd5b610151600160a060020a0360043516602435610441565b005b341561015e57600080fd5b610166610599565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156101a557808201518382015260200161018d565b505050509050019250505060405180910390f35b34156101c457600080fd5b6101d8600160a060020a0360043516610602565b60405190815260200160405180910390f35b34156101f557600080fd5b610166600160a060020a0360043516610620565b341561021457600080fd5b6101d8600160a060020a03600435811690602435166106ad565b341561023957600080fd5b6101136004356106da565b341561024f57600080fd5b610151600160a060020a0360043516610702565b341561026e57600080fd5b6101d8600160a060020a03600435166108b3565b610151600160a060020a03600435166108d1565b34156102a157600080fd5b61015160048035600160a060020a03169060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610a7b95505050505050565b341561030057600080fd5b610151600160a060020a0360043516610b8b565b341561031f57600080fd5b6101d8610d4c565b341561033257600080fd5b610346600160a060020a0360043516610d51565b604051901515815260200160405180910390f35b341561036557600080fd5b6101d8610d72565b61015160048035600160a060020a03169060248035908101910135610d80565b341561039857600080fd5b6103ac600160a060020a0360043516610f87565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156103e85780820151838201526020016103d0565b50505050905090810190601f1680156104155780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600160a060020a039081166000908152602081905260409020541690565b600160a060020a03808316600090815260208181526040808320339094168352600590930190522054829082908190101561047b57600080fd5b600160a060020a0384166000908152602081905260409020600301546104a7908463ffffffff61104c16565b600160a060020a03808616600090815260208181526040808320600381019590955533909316825260059093019092529020546104ea908463ffffffff61104c16565b600160a060020a0380861660009081526020818152604080832033909416808452600590940190915290819020929092559084156108fc0290859051600060405180830381858888f19350505050151561054357600080fd5b7faa0e554f781c3c3b2be110a0557f260f11af9a8aa2c64bc1e7a31dbb21e32fa2338585604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a150505050565b6105a1611074565b60028054806020026020016040519081016040528092919081815260200182805480156105f757602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116105d9575b505050505090505b90565b600160a060020a031660009081526020819052604090206004015490565b610628611074565b6001600083600160a060020a0316600160a060020a031681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156106a157602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610683575b50505050509050919050565b600160a060020a039182166000908152602081815260408083209390941682526005909201909152205490565b60028054829081106106e857fe5b600091825260209091200154600160a060020a0316905081565b600160a060020a038181166000908152602081905260408120549091839133821691161461072f57600080fd5b600160a060020a038316600090815260208190526040902060020154839060ff161561075a57600080fd5b600160a060020a0384166000908152602081905260408120600401548591901161078357600080fd5b600160a060020a0381166000908152602081905260409020600401544310156107ab57600080fd5b600160a060020a03808616600081815260208181526040808320339095168352600585018252822054928252526003909101549094506107f1908563ffffffff61104c16565b600160a060020a0380871660008181526020818152604080832060038101969096553390941680835260058601825284832083905592825281905260049093019290925585156108fc0290869051600060405180830381858888f19350505050151561085c57600080fd5b7f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb338686604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15050505050565b600160a060020a031660009081526020819052604090206003015490565b600160a060020a038116600090815260208190526040902060020154819060ff1615156108fd57600080fd5b600160a060020a038216600090815260208190526040902060030154610929903463ffffffff61105e16565b600160a060020a038084166000908152602081815260408083206003810195909555339093168252600590930190925290205415156109c057600160a060020a038216600090815260016020819052604090912080549091810161098d8382611086565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03161790555b600160a060020a038083166000908152602081815260408083203390941683526005909301905220546109f9903463ffffffff61105e16565b600160a060020a0380841660009081526020818152604080832033948516845260050190915290819020929092557f66a9138482c99e9baf08860110ef332cc0c23b4a199a53593d8db0fc8f96fbfc918490349051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15050565b600160a060020a038281166000908152602081905260409020548391338116911614610aa657600080fd5b600160a060020a0383166000908152602081905260409020600101828051610ad29291602001906110af565b507f63f303264cd4b7a198f0163f96e0b6b1f972f9b73359a70c44241b862879d8a4338484604051600160a060020a0380851682528316602082015260606040820181815290820183818151815260200191508051906020019080838360005b83811015610b4a578082015183820152602001610b32565b50505050905090810190601f168015610b775780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a1505050565b600160a060020a0381811660009081526020819052604081205490918391338216911614610bb857600080fd5b600160a060020a038316600090815260208190526040902060020154839060ff161515610be457600080fd5b600160a060020a0384166000908152602081905260408120600201805460ff191690556003805460001901905592505b600254831015610c965783600160a060020a0316600284815481101515610c3757fe5b600091825260209091200154600160a060020a03161415610c8b576002805484908110610c6057fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19169055610c96565b600190920191610c14565b600160a060020a038416600090815260208190526040902060040154610cd590606490610cc9904363ffffffff61105e16565b9063ffffffff61105e16565b60008086600160a060020a0316600160a060020a03168152602001908152602001600020600401819055507f4edf3e325d0063213a39f9085522994a1c44bea5f39e7d63ef61260a1e58c6d33385604051600160a060020a039283168152911660208201526040908101905180910390a150505050565b606381565b600160a060020a031660009081526020819052604090206002015460ff1690565b690a968163f0a57b40000081565b690a968163f0a57b400000341015610d9757600080fd5b600160a060020a038316600090815260208190526040902060020154839060ff1615610dc257600080fd5b6002805460018101610dd48382611086565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03861617905560a06040519081016040528033600160a060020a0316815260200184848080601f0160208091040260200160405190810160405281815292919060208401838380828437505050928452505060016020808401919091523460408085019190915260006060909401849052600160a060020a03891684529083905290912090508151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015181600101908051610eca9291602001906110af565b50604082015160028201805460ff191691151591909117905560608201518160030155608082015160049091015550600160a060020a038085166000908152602081815260408083203394851684526005019091529081902034908190556003805460010190557f7635f1d87b47fba9f2b09e56eb4be75cca030e0cb179c1602ac9261d39a8f5c1929187919051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a150505050565b610f8f611074565b60008083600160a060020a0316600160a060020a031681526020019081526020016000206001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106a15780601f1061101f576101008083540402835291602001916106a1565b820191906000526020600020905b81548152906001019060200180831161102d5750939695505050505050565b60008282111561105857fe5b50900390565b60008282018381101561106d57fe5b9392505050565b60206040519081016040526000815290565b8154818355818115116110aa576000838152602090206110aa91810190830161112d565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106110f057805160ff191683800117855561111d565b8280016001018555821561111d579182015b8281111561111d578251825591602001919060010190611102565b5061112992915061112d565b5090565b6105ff91905b8082111561112957600081556001016111335600a165627a7a72305820d2d4c6e641bc033beae9eb0c9fca10f5c9c68a746bc1b0099a8da4c99a3532d30029` +const TomoValidatorBin = `0x6060604052600060035534156200001557600080fd5b6040516200144c3803806200144c833981016040528080518201919060200180519091019050600060028380516200005292916020019062000171565b50600090505b8251811015620001685760a06040519081016040528033600160a060020a0316815260200160206040519081016040908152600082529082526001602083015201838381518110620000a657fe5b9060200190602002015181526020016000815250600080858481518110620000ca57fe5b90602001906020020151600160a060020a03168152602081019190915260400160002081518154600160a060020a031916600160a060020a039190911617815560208201518160010190805162000126929160200190620001dd565b50604082015160028201805460ff1916911515919091179055606082015181600301556080820151600490910155506003805460019081019091550162000058565b505050620002a5565b828054828255906000526020600020908101928215620001cb579160200282015b82811115620001cb5782518254600160a060020a031916600160a060020a03919091161782556020929092019160019091019062000192565b50620001d99291506200025e565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200022057805160ff191683800117855562000250565b8280016001018555821562000250579182015b828111156200025057825182559160200191906001019062000233565b50620001d992915062000288565b6200028591905b80821115620001d9578054600160a060020a031916815560010162000265565b90565b6200028591905b80821115620001d957600081556001016200028f565b61119780620002b56000396000f3006060604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302aa9be2811461010057806306a49fce14610124578063282652941461018a5780632d15cc04146101bb578063302b6872146101da5780633477ee2e146101ff57806351cff8d91461023157806358e7525f146102505780636dd7d8ea1461026f578063a3ec796514610283578063ae6e43f5146102e2578063b642facd14610301578063d09f1ab414610320578063d161c76714610333578063d51b9e9314610346578063d55b7dff14610379578063d6f0948c1461038c578063da67b599146103ac575b600080fd5b341561010b57600080fd5b610122600160a060020a0360043516602435610442565b005b341561012f57600080fd5b61013761059a565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561017657808201518382015260200161015e565b505050509050019250505060405180910390f35b341561019557600080fd5b6101a9600160a060020a0360043516610603565b60405190815260200160405180910390f35b34156101c657600080fd5b610137600160a060020a0360043516610621565b34156101e557600080fd5b6101a9600160a060020a03600435811690602435166106ae565b341561020a57600080fd5b6102156004356106db565b604051600160a060020a03909116815260200160405180910390f35b341561023c57600080fd5b610122600160a060020a0360043516610703565b341561025b57600080fd5b6101a9600160a060020a03600435166108b4565b610122600160a060020a03600435166108d2565b341561028e57600080fd5b61012260048035600160a060020a03169060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610a7c95505050505050565b34156102ed57600080fd5b610122600160a060020a0360043516610b8c565b341561030c57600080fd5b610215600160a060020a0360043516610d4d565b341561032b57600080fd5b6101a9610d6b565b341561033e57600080fd5b6101a9610d70565b341561035157600080fd5b610365600160a060020a0360043516610d75565b604051901515815260200160405180910390f35b341561038457600080fd5b6101a9610d96565b61012260048035600160a060020a03169060248035908101910135610da4565b34156103b757600080fd5b6103cb600160a060020a0360043516610fab565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156104075780820151838201526020016103ef565b50505050905090810190601f1680156104345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600160a060020a03808316600090815260208181526040808320339094168352600590930190522054829082908190101561047c57600080fd5b600160a060020a0384166000908152602081905260409020600301546104a8908463ffffffff61107016565b600160a060020a03808616600090815260208181526040808320600381019590955533909316825260059093019092529020546104eb908463ffffffff61107016565b600160a060020a0380861660009081526020818152604080832033909416808452600590940190915290819020929092559084156108fc0290859051600060405180830381858888f19350505050151561054457600080fd5b7faa0e554f781c3c3b2be110a0557f260f11af9a8aa2c64bc1e7a31dbb21e32fa2338585604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a150505050565b6105a2611098565b60028054806020026020016040519081016040528092919081815260200182805480156105f857602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116105da575b505050505090505b90565b600160a060020a031660009081526020819052604090206004015490565b610629611098565b6001600083600160a060020a0316600160a060020a031681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156106a257602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610684575b50505050509050919050565b600160a060020a039182166000908152602081815260408083209390941682526005909201909152205490565b60028054829081106106e957fe5b600091825260209091200154600160a060020a0316905081565b600160a060020a038181166000908152602081905260408120549091839133821691161461073057600080fd5b600160a060020a038316600090815260208190526040902060020154839060ff161561075b57600080fd5b600160a060020a0384166000908152602081905260408120600401548591901161078457600080fd5b600160a060020a0381166000908152602081905260409020600401544310156107ac57600080fd5b600160a060020a03808616600081815260208181526040808320339095168352600585018252822054928252526003909101549094506107f2908563ffffffff61107016565b600160a060020a0380871660008181526020818152604080832060038101969096553390941680835260058601825284832083905592825281905260049093019290925585156108fc0290869051600060405180830381858888f19350505050151561085d57600080fd5b7f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb338686604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15050505050565b600160a060020a031660009081526020819052604090206003015490565b600160a060020a038116600090815260208190526040902060020154819060ff1615156108fe57600080fd5b600160a060020a03821660009081526020819052604090206003015461092a903463ffffffff61108216565b600160a060020a038084166000908152602081815260408083206003810195909555339093168252600590930190925290205415156109c157600160a060020a038216600090815260016020819052604090912080549091810161098e83826110aa565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03161790555b600160a060020a038083166000908152602081815260408083203390941683526005909301905220546109fa903463ffffffff61108216565b600160a060020a0380841660009081526020818152604080832033948516845260050190915290819020929092557f66a9138482c99e9baf08860110ef332cc0c23b4a199a53593d8db0fc8f96fbfc918490349051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15050565b600160a060020a038281166000908152602081905260409020548391338116911614610aa757600080fd5b600160a060020a0383166000908152602081905260409020600101828051610ad39291602001906110d3565b507f63f303264cd4b7a198f0163f96e0b6b1f972f9b73359a70c44241b862879d8a4338484604051600160a060020a0380851682528316602082015260606040820181815290820183818151815260200191508051906020019080838360005b83811015610b4b578082015183820152602001610b33565b50505050905090810190601f168015610b785780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a1505050565b600160a060020a0381811660009081526020819052604081205490918391338216911614610bb957600080fd5b600160a060020a038316600090815260208190526040902060020154839060ff161515610be557600080fd5b600160a060020a0384166000908152602081905260408120600201805460ff191690556003805460001901905592505b600254831015610c975783600160a060020a0316600284815481101515610c3857fe5b600091825260209091200154600160a060020a03161415610c8c576002805484908110610c6157fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19169055610c97565b600190920191610c15565b600160a060020a038416600090815260208190526040902060040154610cd690606490610cca904363ffffffff61108216565b9063ffffffff61108216565b60008086600160a060020a0316600160a060020a03168152602001908152602001600020600401819055507f4edf3e325d0063213a39f9085522994a1c44bea5f39e7d63ef61260a1e58c6d33385604051600160a060020a039283168152911660208201526040908101905180910390a150505050565b600160a060020a039081166000908152602081905260409020541690565b606381565b606481565b600160a060020a031660009081526020819052604090206002015460ff1690565b690a968163f0a57b40000081565b690a968163f0a57b400000341015610dbb57600080fd5b600160a060020a038316600090815260208190526040902060020154839060ff1615610de657600080fd5b6002805460018101610df883826110aa565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03861617905560a06040519081016040528033600160a060020a0316815260200184848080601f0160208091040260200160405190810160405281815292919060208401838380828437505050928452505060016020808401919091523460408085019190915260006060909401849052600160a060020a03891684529083905290912090508151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015181600101908051610eee9291602001906110d3565b50604082015160028201805460ff191691151591909117905560608201518160030155608082015160049091015550600160a060020a038085166000908152602081815260408083203394851684526005019091529081902034908190556003805460010190557f7635f1d87b47fba9f2b09e56eb4be75cca030e0cb179c1602ac9261d39a8f5c1929187919051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a150505050565b610fb3611098565b60008083600160a060020a0316600160a060020a031681526020019081526020016000206001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106a25780601f10611043576101008083540402835291602001916106a2565b820191906000526020600020905b8154815290600101906020018083116110515750939695505050505050565b60008282111561107c57fe5b50900390565b60008282018381101561109157fe5b9392505050565b60206040519081016040526000815290565b8154818355818115116110ce576000838152602090206110ce918101908301611151565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061111457805160ff1916838001178555611141565b82800160010185558215611141579182015b82811115611141578251825591602001919060010190611126565b5061114d929150611151565b5090565b61060091905b8082111561114d57600081556001016111575600a165627a7a723058207dd61e3603de213ecbfbe51aaea6f960b2920c475048e55de0d1b16fd89c7a900029` // DeployTomoValidator deploys a new Ethereum contract, binding an instance of TomoValidator to it. func DeployTomoValidator(auth *bind.TransactOpts, backend bind.ContractBackend, _candidates []common.Address, _caps []*big.Int) (common.Address, *types.Transaction, *TomoValidator, error) { @@ -540,6 +540,32 @@ func (_TomoValidator *TomoValidatorTransactorRaw) Transact(opts *bind.TransactOp return _TomoValidator.Contract.contract.Transact(opts, method, params...) } +// CandidateWithdrawDelay is a free data retrieval call binding the contract method 0xd161c767. +// +// Solidity: function candidateWithdrawDelay() constant returns(uint256) +func (_TomoValidator *TomoValidatorCaller) CandidateWithdrawDelay(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TomoValidator.contract.Call(opts, out, "candidateWithdrawDelay") + return *ret0, err +} + +// CandidateWithdrawDelay is a free data retrieval call binding the contract method 0xd161c767. +// +// Solidity: function candidateWithdrawDelay() constant returns(uint256) +func (_TomoValidator *TomoValidatorSession) CandidateWithdrawDelay() (*big.Int, error) { + return _TomoValidator.Contract.CandidateWithdrawDelay(&_TomoValidator.CallOpts) +} + +// CandidateWithdrawDelay is a free data retrieval call binding the contract method 0xd161c767. +// +// Solidity: function candidateWithdrawDelay() constant returns(uint256) +func (_TomoValidator *TomoValidatorCallerSession) CandidateWithdrawDelay() (*big.Int, error) { + return _TomoValidator.Contract.CandidateWithdrawDelay(&_TomoValidator.CallOpts) +} + // Candidates is a free data retrieval call binding the contract method 0x3477ee2e. // // Solidity: function candidates( uint256) constant returns(address) @@ -566,32 +592,6 @@ func (_TomoValidator *TomoValidatorCallerSession) Candidates(arg0 *big.Int) (com return _TomoValidator.Contract.Candidates(&_TomoValidator.CallOpts, arg0) } -// GetCandidateBacker is a free data retrieval call binding the contract method 0x00a95501. -// -// Solidity: function getCandidateBacker(_candidate address) constant returns(address) -func (_TomoValidator *TomoValidatorCaller) GetCandidateBacker(opts *bind.CallOpts, _candidate common.Address) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _TomoValidator.contract.Call(opts, out, "getCandidateBacker", _candidate) - return *ret0, err -} - -// GetCandidateBacker is a free data retrieval call binding the contract method 0x00a95501. -// -// Solidity: function getCandidateBacker(_candidate address) constant returns(address) -func (_TomoValidator *TomoValidatorSession) GetCandidateBacker(_candidate common.Address) (common.Address, error) { - return _TomoValidator.Contract.GetCandidateBacker(&_TomoValidator.CallOpts, _candidate) -} - -// GetCandidateBacker is a free data retrieval call binding the contract method 0x00a95501. -// -// Solidity: function getCandidateBacker(_candidate address) constant returns(address) -func (_TomoValidator *TomoValidatorCallerSession) GetCandidateBacker(_candidate common.Address) (common.Address, error) { - return _TomoValidator.Contract.GetCandidateBacker(&_TomoValidator.CallOpts, _candidate) -} - // GetCandidateCap is a free data retrieval call binding the contract method 0x58e7525f. // // Solidity: function getCandidateCap(_candidate address) constant returns(uint256) @@ -644,6 +644,32 @@ func (_TomoValidator *TomoValidatorCallerSession) GetCandidateNodeUrl(_candidate return _TomoValidator.Contract.GetCandidateNodeUrl(&_TomoValidator.CallOpts, _candidate) } +// GetCandidateOwner is a free data retrieval call binding the contract method 0xb642facd. +// +// Solidity: function getCandidateOwner(_candidate address) constant returns(address) +func (_TomoValidator *TomoValidatorCaller) GetCandidateOwner(opts *bind.CallOpts, _candidate common.Address) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _TomoValidator.contract.Call(opts, out, "getCandidateOwner", _candidate) + return *ret0, err +} + +// GetCandidateOwner is a free data retrieval call binding the contract method 0xb642facd. +// +// Solidity: function getCandidateOwner(_candidate address) constant returns(address) +func (_TomoValidator *TomoValidatorSession) GetCandidateOwner(_candidate common.Address) (common.Address, error) { + return _TomoValidator.Contract.GetCandidateOwner(&_TomoValidator.CallOpts, _candidate) +} + +// GetCandidateOwner is a free data retrieval call binding the contract method 0xb642facd. +// +// Solidity: function getCandidateOwner(_candidate address) constant returns(address) +func (_TomoValidator *TomoValidatorCallerSession) GetCandidateOwner(_candidate common.Address) (common.Address, error) { + return _TomoValidator.Contract.GetCandidateOwner(&_TomoValidator.CallOpts, _candidate) +} + // GetCandidateWithdrawBlockNumber is a free data retrieval call binding the contract method 0x28265294. // // Solidity: function getCandidateWithdrawBlockNumber(_candidate address) constant returns(uint256) @@ -1021,7 +1047,7 @@ func (it *TomoValidatorProposeIterator) Close() error { // TomoValidatorPropose represents a Propose event raised by the TomoValidator contract. type TomoValidatorPropose struct { - Backer common.Address + Owner common.Address Candidate common.Address Cap *big.Int Raw types.Log // Blockchain specific contextual infos @@ -1029,7 +1055,7 @@ type TomoValidatorPropose struct { // FilterPropose is a free log retrieval operation binding the contract event 0x7635f1d87b47fba9f2b09e56eb4be75cca030e0cb179c1602ac9261d39a8f5c1. // -// Solidity: event Propose(_backer address, _candidate address, _cap uint256) +// Solidity: event Propose(_owner address, _candidate address, _cap uint256) func (_TomoValidator *TomoValidatorFilterer) FilterPropose(opts *bind.FilterOpts) (*TomoValidatorProposeIterator, error) { logs, sub, err := _TomoValidator.contract.FilterLogs(opts, "Propose") @@ -1041,7 +1067,7 @@ func (_TomoValidator *TomoValidatorFilterer) FilterPropose(opts *bind.FilterOpts // WatchPropose is a free log subscription operation binding the contract event 0x7635f1d87b47fba9f2b09e56eb4be75cca030e0cb179c1602ac9261d39a8f5c1. // -// Solidity: event Propose(_backer address, _candidate address, _cap uint256) +// Solidity: event Propose(_owner address, _candidate address, _cap uint256) func (_TomoValidator *TomoValidatorFilterer) WatchPropose(opts *bind.WatchOpts, sink chan<- *TomoValidatorPropose) (event.Subscription, error) { logs, sub, err := _TomoValidator.contract.WatchLogs(opts, "Propose") @@ -1145,14 +1171,14 @@ func (it *TomoValidatorResignIterator) Close() error { // TomoValidatorResign represents a Resign event raised by the TomoValidator contract. type TomoValidatorResign struct { - Backer common.Address + Owner common.Address Candidate common.Address Raw types.Log // Blockchain specific contextual infos } // FilterResign is a free log retrieval operation binding the contract event 0x4edf3e325d0063213a39f9085522994a1c44bea5f39e7d63ef61260a1e58c6d3. // -// Solidity: event Resign(_backer address, _candidate address) +// Solidity: event Resign(_owner address, _candidate address) func (_TomoValidator *TomoValidatorFilterer) FilterResign(opts *bind.FilterOpts) (*TomoValidatorResignIterator, error) { logs, sub, err := _TomoValidator.contract.FilterLogs(opts, "Resign") @@ -1164,7 +1190,7 @@ func (_TomoValidator *TomoValidatorFilterer) FilterResign(opts *bind.FilterOpts) // WatchResign is a free log subscription operation binding the contract event 0x4edf3e325d0063213a39f9085522994a1c44bea5f39e7d63ef61260a1e58c6d3. // -// Solidity: event Resign(_backer address, _candidate address) +// Solidity: event Resign(_owner address, _candidate address) func (_TomoValidator *TomoValidatorFilterer) WatchResign(opts *bind.WatchOpts, sink chan<- *TomoValidatorResign) (event.Subscription, error) { logs, sub, err := _TomoValidator.contract.WatchLogs(opts, "Resign") @@ -1268,7 +1294,7 @@ func (it *TomoValidatorSetNodeUrlIterator) Close() error { // TomoValidatorSetNodeUrl represents a SetNodeUrl event raised by the TomoValidator contract. type TomoValidatorSetNodeUrl struct { - Backer common.Address + Owner common.Address Candidate common.Address NodeUrl string Raw types.Log // Blockchain specific contextual infos @@ -1276,7 +1302,7 @@ type TomoValidatorSetNodeUrl struct { // FilterSetNodeUrl is a free log retrieval operation binding the contract event 0x63f303264cd4b7a198f0163f96e0b6b1f972f9b73359a70c44241b862879d8a4. // -// Solidity: event SetNodeUrl(_backer address, _candidate address, _nodeUrl string) +// Solidity: event SetNodeUrl(_owner address, _candidate address, _nodeUrl string) func (_TomoValidator *TomoValidatorFilterer) FilterSetNodeUrl(opts *bind.FilterOpts) (*TomoValidatorSetNodeUrlIterator, error) { logs, sub, err := _TomoValidator.contract.FilterLogs(opts, "SetNodeUrl") @@ -1288,7 +1314,7 @@ func (_TomoValidator *TomoValidatorFilterer) FilterSetNodeUrl(opts *bind.FilterO // WatchSetNodeUrl is a free log subscription operation binding the contract event 0x63f303264cd4b7a198f0163f96e0b6b1f972f9b73359a70c44241b862879d8a4. // -// Solidity: event SetNodeUrl(_backer address, _candidate address, _nodeUrl string) +// Solidity: event SetNodeUrl(_owner address, _candidate address, _nodeUrl string) func (_TomoValidator *TomoValidatorFilterer) WatchSetNodeUrl(opts *bind.WatchOpts, sink chan<- *TomoValidatorSetNodeUrl) (event.Subscription, error) { logs, sub, err := _TomoValidator.contract.WatchLogs(opts, "SetNodeUrl") @@ -1640,7 +1666,7 @@ func (it *TomoValidatorWithdrawIterator) Close() error { // TomoValidatorWithdraw represents a Withdraw event raised by the TomoValidator contract. type TomoValidatorWithdraw struct { - Backer common.Address + Owner common.Address Candidate common.Address Cap *big.Int Raw types.Log // Blockchain specific contextual infos @@ -1648,7 +1674,7 @@ type TomoValidatorWithdraw struct { // FilterWithdraw is a free log retrieval operation binding the contract event 0x9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb. // -// Solidity: event Withdraw(_backer address, _candidate address, _cap uint256) +// Solidity: event Withdraw(_owner address, _candidate address, _cap uint256) func (_TomoValidator *TomoValidatorFilterer) FilterWithdraw(opts *bind.FilterOpts) (*TomoValidatorWithdrawIterator, error) { logs, sub, err := _TomoValidator.contract.FilterLogs(opts, "Withdraw") @@ -1660,7 +1686,7 @@ func (_TomoValidator *TomoValidatorFilterer) FilterWithdraw(opts *bind.FilterOpt // WatchWithdraw is a free log subscription operation binding the contract event 0x9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb. // -// Solidity: event Withdraw(_backer address, _candidate address, _cap uint256) +// Solidity: event Withdraw(_owner address, _candidate address, _cap uint256) func (_TomoValidator *TomoValidatorFilterer) WatchWithdraw(opts *bind.WatchOpts, sink chan<- *TomoValidatorWithdraw) (event.Subscription, error) { logs, sub, err := _TomoValidator.contract.WatchLogs(opts, "Withdraw") diff --git a/contracts/validator/validator_test.go b/contracts/validator/validator_test.go index 0d6f4c5108..e7cf3c88a9 100644 --- a/contracts/validator/validator_test.go +++ b/contracts/validator/validator_test.go @@ -33,8 +33,8 @@ func TestValidator(t *testing.T) { for _, it := range candidates { cap, _ := validator.GetCandidateCap(it) t.Log("candidate", it.String(), "cap", cap) - backer, _ := validator.GetCandidateBacker(it) - t.Log("candidate", it.String(), "backer", backer.String()) + owner, _ := validator.GetCandidateOwner(it) + t.Log("candidate", it.String(), "validator owner", owner.String()) } contractBackend.Commit() }