diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 2cf43b3a8..487b1797a 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -393,7 +393,7 @@ func startQuorumPermissionService(ctx *cli.Context, stack *node.Node) { if v == nil { utils.Fatalf("Failed to start Quorum Permission API %s", apiName) } - qapi := v.(*quorum.PermissionAPI) + qapi := v.(*quorum.QuorumControlsAPI) rpcClient, err := stack.Attach() if err != nil { utils.Fatalf("Failed to attach to self: %v", err) diff --git a/controls/bind/clusterkey_binding.go b/controls/bind/clusterkey_binding.go index 84fb2ef47..08aec1457 100644 --- a/controls/bind/clusterkey_binding.go +++ b/controls/bind/clusterkey_binding.go @@ -15,7 +15,7 @@ import ( ) // ClusterABI is the input ABI used to generate the binding from. -const ClusterABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"printAllOrg\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"approvePendingOp\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_privateKey\",\"type\":\"string\"}],\"name\":\"deleteOrgKey\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"addVoter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"deleteVoter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"printAllVoter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_privateKey\",\"type\":\"string\"}],\"name\":\"addOrgKey\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_privateKey\",\"type\":\"string\"}],\"name\":\"OrgKeyAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_privateKey\",\"type\":\"string\"}],\"name\":\"OrgKeyDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_voterAccount\",\"type\":\"string\"}],\"name\":\"orgVoterAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_privateKey\",\"type\":\"string\"}],\"name\":\"KeyNotFound\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"OrgNotFound\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_privateKey\",\"type\":\"string\"}],\"name\":\"KeyExists\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"VoterAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"VoterExists\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"VoterNotFound\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"VoterAccountDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"NoVotingAccount\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"PendingApproval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_pendingOp\",\"type\":\"uint8\"},{\"indexed\":false,\"name\":\"_privateKey\",\"type\":\"string\"}],\"name\":\"ItemForApproval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"NothingToApprove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_privateKey\",\"type\":\"string\"}],\"name\":\"PrintAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_voterAccount\",\"type\":\"address\"}],\"name\":\"PrintVoter\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_pendingOp\",\"type\":\"uint8\"},{\"indexed\":false,\"name\":\"_pendingKey\",\"type\":\"string\"}],\"name\":\"PrintKey\",\"type\":\"event\"}]" +const ClusterABI = "[{\"constant\":false,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_morgId\",\"type\":\"string\"}],\"name\":\"addSubOrg\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"approvePendingOp\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"deleteOrgKey\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_morgId\",\"type\":\"string\"},{\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"addVoter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_morgId\",\"type\":\"string\"},{\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"deleteVoter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_morgId\",\"type\":\"string\"}],\"name\":\"addMasterOrg\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"addOrgKey\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_morgId\",\"type\":\"string\"}],\"name\":\"checkMasterOrgExists\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"MasterOrgAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"MasterOrgExists\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"MasterOrgNotFound\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"SubOrgAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"SubOrgExists\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"SubOrgNotFound\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"OrgKeyAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"OrgKeyDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"KeyNotFound\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"KeyExists\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"OrgNotFound\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"PendingApproval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_pendingOp\",\"type\":\"uint8\"},{\"indexed\":false,\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"ItemForApproval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"NothingToApprove\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"NoVotingAccount\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"VoterAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"VoterNotFound\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"VoterDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"VoterExists\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"PrintAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_voterAccount\",\"type\":\"address\"}],\"name\":\"PrintVoter\",\"type\":\"event\"}]" // Cluster is an auto generated Go binding around an Ethereum contract. type Cluster struct { @@ -159,46 +159,114 @@ func (_Cluster *ClusterTransactorRaw) Transact(opts *bind.TransactOpts, method s return _Cluster.Contract.contract.Transact(opts, method, params...) } -// AddOrgKey is a paid mutator transaction binding the contract method 0xd88ce6bb. +// CheckMasterOrgExists is a free data retrieval call binding the contract method 0xd912967a. // -// Solidity: function addOrgKey(_orgId string, _privateKey string) returns() -func (_Cluster *ClusterTransactor) AddOrgKey(opts *bind.TransactOpts, _orgId string, _privateKey string) (*types.Transaction, error) { - return _Cluster.contract.Transact(opts, "addOrgKey", _orgId, _privateKey) +// Solidity: function checkMasterOrgExists(_morgId string) constant returns(bool) +func (_Cluster *ClusterCaller) CheckMasterOrgExists(opts *bind.CallOpts, _morgId string) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _Cluster.contract.Call(opts, out, "checkMasterOrgExists", _morgId) + return *ret0, err +} + +// CheckMasterOrgExists is a free data retrieval call binding the contract method 0xd912967a. +// +// Solidity: function checkMasterOrgExists(_morgId string) constant returns(bool) +func (_Cluster *ClusterSession) CheckMasterOrgExists(_morgId string) (bool, error) { + return _Cluster.Contract.CheckMasterOrgExists(&_Cluster.CallOpts, _morgId) +} + +// CheckMasterOrgExists is a free data retrieval call binding the contract method 0xd912967a. +// +// Solidity: function checkMasterOrgExists(_morgId string) constant returns(bool) +func (_Cluster *ClusterCallerSession) CheckMasterOrgExists(_morgId string) (bool, error) { + return _Cluster.Contract.CheckMasterOrgExists(&_Cluster.CallOpts, _morgId) +} + +// AddMasterOrg is a paid mutator transaction binding the contract method 0xc7304f3f. +// +// Solidity: function addMasterOrg(_morgId string) returns() +func (_Cluster *ClusterTransactor) AddMasterOrg(opts *bind.TransactOpts, _morgId string) (*types.Transaction, error) { + return _Cluster.contract.Transact(opts, "addMasterOrg", _morgId) +} + +// AddMasterOrg is a paid mutator transaction binding the contract method 0xc7304f3f. +// +// Solidity: function addMasterOrg(_morgId string) returns() +func (_Cluster *ClusterSession) AddMasterOrg(_morgId string) (*types.Transaction, error) { + return _Cluster.Contract.AddMasterOrg(&_Cluster.TransactOpts, _morgId) +} + +// AddMasterOrg is a paid mutator transaction binding the contract method 0xc7304f3f. +// +// Solidity: function addMasterOrg(_morgId string) returns() +func (_Cluster *ClusterTransactorSession) AddMasterOrg(_morgId string) (*types.Transaction, error) { + return _Cluster.Contract.AddMasterOrg(&_Cluster.TransactOpts, _morgId) } // AddOrgKey is a paid mutator transaction binding the contract method 0xd88ce6bb. // -// Solidity: function addOrgKey(_orgId string, _privateKey string) returns() -func (_Cluster *ClusterSession) AddOrgKey(_orgId string, _privateKey string) (*types.Transaction, error) { - return _Cluster.Contract.AddOrgKey(&_Cluster.TransactOpts, _orgId, _privateKey) +// Solidity: function addOrgKey(_orgId string, _tmKey string) returns() +func (_Cluster *ClusterTransactor) AddOrgKey(opts *bind.TransactOpts, _orgId string, _tmKey string) (*types.Transaction, error) { + return _Cluster.contract.Transact(opts, "addOrgKey", _orgId, _tmKey) } // AddOrgKey is a paid mutator transaction binding the contract method 0xd88ce6bb. // -// Solidity: function addOrgKey(_orgId string, _privateKey string) returns() -func (_Cluster *ClusterTransactorSession) AddOrgKey(_orgId string, _privateKey string) (*types.Transaction, error) { - return _Cluster.Contract.AddOrgKey(&_Cluster.TransactOpts, _orgId, _privateKey) +// Solidity: function addOrgKey(_orgId string, _tmKey string) returns() +func (_Cluster *ClusterSession) AddOrgKey(_orgId string, _tmKey string) (*types.Transaction, error) { + return _Cluster.Contract.AddOrgKey(&_Cluster.TransactOpts, _orgId, _tmKey) +} + +// AddOrgKey is a paid mutator transaction binding the contract method 0xd88ce6bb. +// +// Solidity: function addOrgKey(_orgId string, _tmKey string) returns() +func (_Cluster *ClusterTransactorSession) AddOrgKey(_orgId string, _tmKey string) (*types.Transaction, error) { + return _Cluster.Contract.AddOrgKey(&_Cluster.TransactOpts, _orgId, _tmKey) +} + +// AddSubOrg is a paid mutator transaction binding the contract method 0x1f953480. +// +// Solidity: function addSubOrg(_orgId string, _morgId string) returns() +func (_Cluster *ClusterTransactor) AddSubOrg(opts *bind.TransactOpts, _orgId string, _morgId string) (*types.Transaction, error) { + return _Cluster.contract.Transact(opts, "addSubOrg", _orgId, _morgId) +} + +// AddSubOrg is a paid mutator transaction binding the contract method 0x1f953480. +// +// Solidity: function addSubOrg(_orgId string, _morgId string) returns() +func (_Cluster *ClusterSession) AddSubOrg(_orgId string, _morgId string) (*types.Transaction, error) { + return _Cluster.Contract.AddSubOrg(&_Cluster.TransactOpts, _orgId, _morgId) +} + +// AddSubOrg is a paid mutator transaction binding the contract method 0x1f953480. +// +// Solidity: function addSubOrg(_orgId string, _morgId string) returns() +func (_Cluster *ClusterTransactorSession) AddSubOrg(_orgId string, _morgId string) (*types.Transaction, error) { + return _Cluster.Contract.AddSubOrg(&_Cluster.TransactOpts, _orgId, _morgId) } // AddVoter is a paid mutator transaction binding the contract method 0x5607395b. // -// Solidity: function addVoter(_orgId string, _address address) returns() -func (_Cluster *ClusterTransactor) AddVoter(opts *bind.TransactOpts, _orgId string, _address common.Address) (*types.Transaction, error) { - return _Cluster.contract.Transact(opts, "addVoter", _orgId, _address) +// Solidity: function addVoter(_morgId string, _address address) returns() +func (_Cluster *ClusterTransactor) AddVoter(opts *bind.TransactOpts, _morgId string, _address common.Address) (*types.Transaction, error) { + return _Cluster.contract.Transact(opts, "addVoter", _morgId, _address) } // AddVoter is a paid mutator transaction binding the contract method 0x5607395b. // -// Solidity: function addVoter(_orgId string, _address address) returns() -func (_Cluster *ClusterSession) AddVoter(_orgId string, _address common.Address) (*types.Transaction, error) { - return _Cluster.Contract.AddVoter(&_Cluster.TransactOpts, _orgId, _address) +// Solidity: function addVoter(_morgId string, _address address) returns() +func (_Cluster *ClusterSession) AddVoter(_morgId string, _address common.Address) (*types.Transaction, error) { + return _Cluster.Contract.AddVoter(&_Cluster.TransactOpts, _morgId, _address) } // AddVoter is a paid mutator transaction binding the contract method 0x5607395b. // -// Solidity: function addVoter(_orgId string, _address address) returns() -func (_Cluster *ClusterTransactorSession) AddVoter(_orgId string, _address common.Address) (*types.Transaction, error) { - return _Cluster.Contract.AddVoter(&_Cluster.TransactOpts, _orgId, _address) +// Solidity: function addVoter(_morgId string, _address address) returns() +func (_Cluster *ClusterTransactorSession) AddVoter(_morgId string, _address common.Address) (*types.Transaction, error) { + return _Cluster.Contract.AddVoter(&_Cluster.TransactOpts, _morgId, _address) } // ApprovePendingOp is a paid mutator transaction binding the contract method 0x35dc4772. @@ -224,86 +292,44 @@ func (_Cluster *ClusterTransactorSession) ApprovePendingOp(_orgId string) (*type // DeleteOrgKey is a paid mutator transaction binding the contract method 0x49379c50. // -// Solidity: function deleteOrgKey(_orgId string, _privateKey string) returns() -func (_Cluster *ClusterTransactor) DeleteOrgKey(opts *bind.TransactOpts, _orgId string, _privateKey string) (*types.Transaction, error) { - return _Cluster.contract.Transact(opts, "deleteOrgKey", _orgId, _privateKey) +// Solidity: function deleteOrgKey(_orgId string, _tmKey string) returns() +func (_Cluster *ClusterTransactor) DeleteOrgKey(opts *bind.TransactOpts, _orgId string, _tmKey string) (*types.Transaction, error) { + return _Cluster.contract.Transact(opts, "deleteOrgKey", _orgId, _tmKey) } // DeleteOrgKey is a paid mutator transaction binding the contract method 0x49379c50. // -// Solidity: function deleteOrgKey(_orgId string, _privateKey string) returns() -func (_Cluster *ClusterSession) DeleteOrgKey(_orgId string, _privateKey string) (*types.Transaction, error) { - return _Cluster.Contract.DeleteOrgKey(&_Cluster.TransactOpts, _orgId, _privateKey) +// Solidity: function deleteOrgKey(_orgId string, _tmKey string) returns() +func (_Cluster *ClusterSession) DeleteOrgKey(_orgId string, _tmKey string) (*types.Transaction, error) { + return _Cluster.Contract.DeleteOrgKey(&_Cluster.TransactOpts, _orgId, _tmKey) } // DeleteOrgKey is a paid mutator transaction binding the contract method 0x49379c50. // -// Solidity: function deleteOrgKey(_orgId string, _privateKey string) returns() -func (_Cluster *ClusterTransactorSession) DeleteOrgKey(_orgId string, _privateKey string) (*types.Transaction, error) { - return _Cluster.Contract.DeleteOrgKey(&_Cluster.TransactOpts, _orgId, _privateKey) +// Solidity: function deleteOrgKey(_orgId string, _tmKey string) returns() +func (_Cluster *ClusterTransactorSession) DeleteOrgKey(_orgId string, _tmKey string) (*types.Transaction, error) { + return _Cluster.Contract.DeleteOrgKey(&_Cluster.TransactOpts, _orgId, _tmKey) } // DeleteVoter is a paid mutator transaction binding the contract method 0x59cbd6fe. // -// Solidity: function deleteVoter(_orgId string, _address address) returns() -func (_Cluster *ClusterTransactor) DeleteVoter(opts *bind.TransactOpts, _orgId string, _address common.Address) (*types.Transaction, error) { - return _Cluster.contract.Transact(opts, "deleteVoter", _orgId, _address) +// Solidity: function deleteVoter(_morgId string, _address address) returns() +func (_Cluster *ClusterTransactor) DeleteVoter(opts *bind.TransactOpts, _morgId string, _address common.Address) (*types.Transaction, error) { + return _Cluster.contract.Transact(opts, "deleteVoter", _morgId, _address) } // DeleteVoter is a paid mutator transaction binding the contract method 0x59cbd6fe. // -// Solidity: function deleteVoter(_orgId string, _address address) returns() -func (_Cluster *ClusterSession) DeleteVoter(_orgId string, _address common.Address) (*types.Transaction, error) { - return _Cluster.Contract.DeleteVoter(&_Cluster.TransactOpts, _orgId, _address) +// Solidity: function deleteVoter(_morgId string, _address address) returns() +func (_Cluster *ClusterSession) DeleteVoter(_morgId string, _address common.Address) (*types.Transaction, error) { + return _Cluster.Contract.DeleteVoter(&_Cluster.TransactOpts, _morgId, _address) } // DeleteVoter is a paid mutator transaction binding the contract method 0x59cbd6fe. // -// Solidity: function deleteVoter(_orgId string, _address address) returns() -func (_Cluster *ClusterTransactorSession) DeleteVoter(_orgId string, _address common.Address) (*types.Transaction, error) { - return _Cluster.Contract.DeleteVoter(&_Cluster.TransactOpts, _orgId, _address) -} - -// PrintAllOrg is a paid mutator transaction binding the contract method 0x2bbc5084. -// -// Solidity: function printAllOrg() returns() -func (_Cluster *ClusterTransactor) PrintAllOrg(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Cluster.contract.Transact(opts, "printAllOrg") -} - -// PrintAllOrg is a paid mutator transaction binding the contract method 0x2bbc5084. -// -// Solidity: function printAllOrg() returns() -func (_Cluster *ClusterSession) PrintAllOrg() (*types.Transaction, error) { - return _Cluster.Contract.PrintAllOrg(&_Cluster.TransactOpts) -} - -// PrintAllOrg is a paid mutator transaction binding the contract method 0x2bbc5084. -// -// Solidity: function printAllOrg() returns() -func (_Cluster *ClusterTransactorSession) PrintAllOrg() (*types.Transaction, error) { - return _Cluster.Contract.PrintAllOrg(&_Cluster.TransactOpts) -} - -// PrintAllVoter is a paid mutator transaction binding the contract method 0x73f9cee0. -// -// Solidity: function printAllVoter() returns() -func (_Cluster *ClusterTransactor) PrintAllVoter(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Cluster.contract.Transact(opts, "printAllVoter") -} - -// PrintAllVoter is a paid mutator transaction binding the contract method 0x73f9cee0. -// -// Solidity: function printAllVoter() returns() -func (_Cluster *ClusterSession) PrintAllVoter() (*types.Transaction, error) { - return _Cluster.Contract.PrintAllVoter(&_Cluster.TransactOpts) -} - -// PrintAllVoter is a paid mutator transaction binding the contract method 0x73f9cee0. -// -// Solidity: function printAllVoter() returns() -func (_Cluster *ClusterTransactorSession) PrintAllVoter() (*types.Transaction, error) { - return _Cluster.Contract.PrintAllVoter(&_Cluster.TransactOpts) +// Solidity: function deleteVoter(_morgId string, _address address) returns() +func (_Cluster *ClusterTransactorSession) DeleteVoter(_morgId string, _address common.Address) (*types.Transaction, error) { + return _Cluster.Contract.DeleteVoter(&_Cluster.TransactOpts, _morgId, _address) } // ClusterItemForApprovalIterator is returned from FilterItemForApproval and is used to iterate over the raw logs and unpacked data for ItemForApproval events raised by the Cluster contract. @@ -375,15 +401,15 @@ func (it *ClusterItemForApprovalIterator) Close() error { // ClusterItemForApproval represents a ItemForApproval event raised by the Cluster contract. type ClusterItemForApproval struct { - OrgId string - PendingOp uint8 - PrivateKey string - Raw types.Log // Blockchain specific contextual infos + OrgId string + PendingOp uint8 + TmKey string + Raw types.Log // Blockchain specific contextual infos } // FilterItemForApproval is a free log retrieval operation binding the contract event 0x4475befcee492797e02530076fd7e138aa058eb3bcd028a9df5c0f2815ba9f4a. // -// Solidity: e ItemForApproval(_orgId string, _pendingOp uint8, _privateKey string) +// Solidity: e ItemForApproval(_orgId string, _pendingOp uint8, _tmKey string) func (_Cluster *ClusterFilterer) FilterItemForApproval(opts *bind.FilterOpts) (*ClusterItemForApprovalIterator, error) { logs, sub, err := _Cluster.contract.FilterLogs(opts, "ItemForApproval") @@ -395,7 +421,7 @@ func (_Cluster *ClusterFilterer) FilterItemForApproval(opts *bind.FilterOpts) (* // WatchItemForApproval is a free log subscription operation binding the contract event 0x4475befcee492797e02530076fd7e138aa058eb3bcd028a9df5c0f2815ba9f4a. // -// Solidity: e ItemForApproval(_orgId string, _pendingOp uint8, _privateKey string) +// Solidity: e ItemForApproval(_orgId string, _pendingOp uint8, _tmKey string) func (_Cluster *ClusterFilterer) WatchItemForApproval(opts *bind.WatchOpts, sink chan<- *ClusterItemForApproval) (event.Subscription, error) { logs, sub, err := _Cluster.contract.WatchLogs(opts, "ItemForApproval") @@ -499,14 +525,14 @@ func (it *ClusterKeyExistsIterator) Close() error { // ClusterKeyExists represents a KeyExists event raised by the Cluster contract. type ClusterKeyExists struct { - OrgId string - PrivateKey string - Raw types.Log // Blockchain specific contextual infos + OrgId string + TmKey string + Raw types.Log // Blockchain specific contextual infos } // FilterKeyExists is a free log retrieval operation binding the contract event 0xfd2bb3c1cfc78c051cb1f0ed88147fb9348eba128a594dc66fbf35dc63fe692d. // -// Solidity: e KeyExists(_orgId string, _privateKey string) +// Solidity: e KeyExists(_orgId string, _tmKey string) func (_Cluster *ClusterFilterer) FilterKeyExists(opts *bind.FilterOpts) (*ClusterKeyExistsIterator, error) { logs, sub, err := _Cluster.contract.FilterLogs(opts, "KeyExists") @@ -518,7 +544,7 @@ func (_Cluster *ClusterFilterer) FilterKeyExists(opts *bind.FilterOpts) (*Cluste // WatchKeyExists is a free log subscription operation binding the contract event 0xfd2bb3c1cfc78c051cb1f0ed88147fb9348eba128a594dc66fbf35dc63fe692d. // -// Solidity: e KeyExists(_orgId string, _privateKey string) +// Solidity: e KeyExists(_orgId string, _tmKey string) func (_Cluster *ClusterFilterer) WatchKeyExists(opts *bind.WatchOpts, sink chan<- *ClusterKeyExists) (event.Subscription, error) { logs, sub, err := _Cluster.contract.WatchLogs(opts, "KeyExists") @@ -622,13 +648,13 @@ func (it *ClusterKeyNotFoundIterator) Close() error { // ClusterKeyNotFound represents a KeyNotFound event raised by the Cluster contract. type ClusterKeyNotFound struct { - PrivateKey string - Raw types.Log // Blockchain specific contextual infos + TmKey string + Raw types.Log // Blockchain specific contextual infos } // FilterKeyNotFound is a free log retrieval operation binding the contract event 0x1625cf45f71f82c8ccf66926c15856f85b1e08dbe285065512100db776fdeb28. // -// Solidity: e KeyNotFound(_privateKey string) +// Solidity: e KeyNotFound(_tmKey string) func (_Cluster *ClusterFilterer) FilterKeyNotFound(opts *bind.FilterOpts) (*ClusterKeyNotFoundIterator, error) { logs, sub, err := _Cluster.contract.FilterLogs(opts, "KeyNotFound") @@ -640,7 +666,7 @@ func (_Cluster *ClusterFilterer) FilterKeyNotFound(opts *bind.FilterOpts) (*Clus // WatchKeyNotFound is a free log subscription operation binding the contract event 0x1625cf45f71f82c8ccf66926c15856f85b1e08dbe285065512100db776fdeb28. // -// Solidity: e KeyNotFound(_privateKey string) +// Solidity: e KeyNotFound(_tmKey string) func (_Cluster *ClusterFilterer) WatchKeyNotFound(opts *bind.WatchOpts, sink chan<- *ClusterKeyNotFound) (event.Subscription, error) { logs, sub, err := _Cluster.contract.WatchLogs(opts, "KeyNotFound") @@ -675,6 +701,372 @@ func (_Cluster *ClusterFilterer) WatchKeyNotFound(opts *bind.WatchOpts, sink cha }), nil } +// ClusterMasterOrgAddedIterator is returned from FilterMasterOrgAdded and is used to iterate over the raw logs and unpacked data for MasterOrgAdded events raised by the Cluster contract. +type ClusterMasterOrgAddedIterator struct { + Event *ClusterMasterOrgAdded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ClusterMasterOrgAddedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ClusterMasterOrgAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ClusterMasterOrgAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ClusterMasterOrgAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ClusterMasterOrgAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ClusterMasterOrgAdded represents a MasterOrgAdded event raised by the Cluster contract. +type ClusterMasterOrgAdded struct { + OrgId string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMasterOrgAdded is a free log retrieval operation binding the contract event 0xfe62f8d1508aa8ddbb57fd8a6d631f4418cfcbafa90c6ce6d4b8105da5609729. +// +// Solidity: e MasterOrgAdded(_orgId string) +func (_Cluster *ClusterFilterer) FilterMasterOrgAdded(opts *bind.FilterOpts) (*ClusterMasterOrgAddedIterator, error) { + + logs, sub, err := _Cluster.contract.FilterLogs(opts, "MasterOrgAdded") + if err != nil { + return nil, err + } + return &ClusterMasterOrgAddedIterator{contract: _Cluster.contract, event: "MasterOrgAdded", logs: logs, sub: sub}, nil +} + +// WatchMasterOrgAdded is a free log subscription operation binding the contract event 0xfe62f8d1508aa8ddbb57fd8a6d631f4418cfcbafa90c6ce6d4b8105da5609729. +// +// Solidity: e MasterOrgAdded(_orgId string) +func (_Cluster *ClusterFilterer) WatchMasterOrgAdded(opts *bind.WatchOpts, sink chan<- *ClusterMasterOrgAdded) (event.Subscription, error) { + + logs, sub, err := _Cluster.contract.WatchLogs(opts, "MasterOrgAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ClusterMasterOrgAdded) + if err := _Cluster.contract.UnpackLog(event, "MasterOrgAdded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ClusterMasterOrgExistsIterator is returned from FilterMasterOrgExists and is used to iterate over the raw logs and unpacked data for MasterOrgExists events raised by the Cluster contract. +type ClusterMasterOrgExistsIterator struct { + Event *ClusterMasterOrgExists // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ClusterMasterOrgExistsIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ClusterMasterOrgExists) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ClusterMasterOrgExists) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ClusterMasterOrgExistsIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ClusterMasterOrgExistsIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ClusterMasterOrgExists represents a MasterOrgExists event raised by the Cluster contract. +type ClusterMasterOrgExists struct { + OrgId string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMasterOrgExists is a free log retrieval operation binding the contract event 0x5c3bfabea6adb09ab9fcc026934927d15573bb92c42edcf1a4052b2342089f5e. +// +// Solidity: e MasterOrgExists(_orgId string) +func (_Cluster *ClusterFilterer) FilterMasterOrgExists(opts *bind.FilterOpts) (*ClusterMasterOrgExistsIterator, error) { + + logs, sub, err := _Cluster.contract.FilterLogs(opts, "MasterOrgExists") + if err != nil { + return nil, err + } + return &ClusterMasterOrgExistsIterator{contract: _Cluster.contract, event: "MasterOrgExists", logs: logs, sub: sub}, nil +} + +// WatchMasterOrgExists is a free log subscription operation binding the contract event 0x5c3bfabea6adb09ab9fcc026934927d15573bb92c42edcf1a4052b2342089f5e. +// +// Solidity: e MasterOrgExists(_orgId string) +func (_Cluster *ClusterFilterer) WatchMasterOrgExists(opts *bind.WatchOpts, sink chan<- *ClusterMasterOrgExists) (event.Subscription, error) { + + logs, sub, err := _Cluster.contract.WatchLogs(opts, "MasterOrgExists") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ClusterMasterOrgExists) + if err := _Cluster.contract.UnpackLog(event, "MasterOrgExists", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ClusterMasterOrgNotFoundIterator is returned from FilterMasterOrgNotFound and is used to iterate over the raw logs and unpacked data for MasterOrgNotFound events raised by the Cluster contract. +type ClusterMasterOrgNotFoundIterator struct { + Event *ClusterMasterOrgNotFound // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ClusterMasterOrgNotFoundIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ClusterMasterOrgNotFound) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ClusterMasterOrgNotFound) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ClusterMasterOrgNotFoundIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ClusterMasterOrgNotFoundIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ClusterMasterOrgNotFound represents a MasterOrgNotFound event raised by the Cluster contract. +type ClusterMasterOrgNotFound struct { + OrgId string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMasterOrgNotFound is a free log retrieval operation binding the contract event 0xa4f69f0a4296104a861bac36ea23551d6d71a4b2d9f788ea28468eef956b4e57. +// +// Solidity: e MasterOrgNotFound(_orgId string) +func (_Cluster *ClusterFilterer) FilterMasterOrgNotFound(opts *bind.FilterOpts) (*ClusterMasterOrgNotFoundIterator, error) { + + logs, sub, err := _Cluster.contract.FilterLogs(opts, "MasterOrgNotFound") + if err != nil { + return nil, err + } + return &ClusterMasterOrgNotFoundIterator{contract: _Cluster.contract, event: "MasterOrgNotFound", logs: logs, sub: sub}, nil +} + +// WatchMasterOrgNotFound is a free log subscription operation binding the contract event 0xa4f69f0a4296104a861bac36ea23551d6d71a4b2d9f788ea28468eef956b4e57. +// +// Solidity: e MasterOrgNotFound(_orgId string) +func (_Cluster *ClusterFilterer) WatchMasterOrgNotFound(opts *bind.WatchOpts, sink chan<- *ClusterMasterOrgNotFound) (event.Subscription, error) { + + logs, sub, err := _Cluster.contract.WatchLogs(opts, "MasterOrgNotFound") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ClusterMasterOrgNotFound) + if err := _Cluster.contract.UnpackLog(event, "MasterOrgNotFound", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + // ClusterNoVotingAccountIterator is returned from FilterNoVotingAccount and is used to iterate over the raw logs and unpacked data for NoVotingAccount events raised by the Cluster contract. type ClusterNoVotingAccountIterator struct { Event *ClusterNoVotingAccount // Event containing the contract specifics and raw log @@ -988,14 +1380,14 @@ func (it *ClusterOrgKeyAddedIterator) Close() error { // ClusterOrgKeyAdded represents a OrgKeyAdded event raised by the Cluster contract. type ClusterOrgKeyAdded struct { - OrgId string - PrivateKey string - Raw types.Log // Blockchain specific contextual infos + OrgId string + TmKey string + Raw types.Log // Blockchain specific contextual infos } // FilterOrgKeyAdded is a free log retrieval operation binding the contract event 0x6f4d370520782587dabc737a258f46de81ad45d733a42cd5a0045cff1e46deb4. // -// Solidity: e OrgKeyAdded(_orgId string, _privateKey string) +// Solidity: e OrgKeyAdded(_orgId string, _tmKey string) func (_Cluster *ClusterFilterer) FilterOrgKeyAdded(opts *bind.FilterOpts) (*ClusterOrgKeyAddedIterator, error) { logs, sub, err := _Cluster.contract.FilterLogs(opts, "OrgKeyAdded") @@ -1007,7 +1399,7 @@ func (_Cluster *ClusterFilterer) FilterOrgKeyAdded(opts *bind.FilterOpts) (*Clus // WatchOrgKeyAdded is a free log subscription operation binding the contract event 0x6f4d370520782587dabc737a258f46de81ad45d733a42cd5a0045cff1e46deb4. // -// Solidity: e OrgKeyAdded(_orgId string, _privateKey string) +// Solidity: e OrgKeyAdded(_orgId string, _tmKey string) func (_Cluster *ClusterFilterer) WatchOrgKeyAdded(opts *bind.WatchOpts, sink chan<- *ClusterOrgKeyAdded) (event.Subscription, error) { logs, sub, err := _Cluster.contract.WatchLogs(opts, "OrgKeyAdded") @@ -1111,14 +1503,14 @@ func (it *ClusterOrgKeyDeletedIterator) Close() error { // ClusterOrgKeyDeleted represents a OrgKeyDeleted event raised by the Cluster contract. type ClusterOrgKeyDeleted struct { - OrgId string - PrivateKey string - Raw types.Log // Blockchain specific contextual infos + OrgId string + TmKey string + Raw types.Log // Blockchain specific contextual infos } // FilterOrgKeyDeleted is a free log retrieval operation binding the contract event 0x2e0a2dc845dce9ef7206b8fe38f3dacaad17ba74d7be9fba469c9858ae16a5d6. // -// Solidity: e OrgKeyDeleted(_orgId string, _privateKey string) +// Solidity: e OrgKeyDeleted(_orgId string, _tmKey string) func (_Cluster *ClusterFilterer) FilterOrgKeyDeleted(opts *bind.FilterOpts) (*ClusterOrgKeyDeletedIterator, error) { logs, sub, err := _Cluster.contract.FilterLogs(opts, "OrgKeyDeleted") @@ -1130,7 +1522,7 @@ func (_Cluster *ClusterFilterer) FilterOrgKeyDeleted(opts *bind.FilterOpts) (*Cl // WatchOrgKeyDeleted is a free log subscription operation binding the contract event 0x2e0a2dc845dce9ef7206b8fe38f3dacaad17ba74d7be9fba469c9858ae16a5d6. // -// Solidity: e OrgKeyDeleted(_orgId string, _privateKey string) +// Solidity: e OrgKeyDeleted(_orgId string, _tmKey string) func (_Cluster *ClusterFilterer) WatchOrgKeyDeleted(opts *bind.WatchOpts, sink chan<- *ClusterOrgKeyDeleted) (event.Subscription, error) { logs, sub, err := _Cluster.contract.WatchLogs(opts, "OrgKeyDeleted") @@ -1478,14 +1870,14 @@ func (it *ClusterPrintAllIterator) Close() error { // ClusterPrintAll represents a PrintAll event raised by the Cluster contract. type ClusterPrintAll struct { - OrgId string - PrivateKey string - Raw types.Log // Blockchain specific contextual infos + OrgId string + TmKey string + Raw types.Log // Blockchain specific contextual infos } // FilterPrintAll is a free log retrieval operation binding the contract event 0x3d030f7cce2619e90f621cb560eb4327f74d9a412c2daa8bed5a892d759187ec. // -// Solidity: e PrintAll(_orgId string, _privateKey string) +// Solidity: e PrintAll(_orgId string, _tmKey string) func (_Cluster *ClusterFilterer) FilterPrintAll(opts *bind.FilterOpts) (*ClusterPrintAllIterator, error) { logs, sub, err := _Cluster.contract.FilterLogs(opts, "PrintAll") @@ -1497,7 +1889,7 @@ func (_Cluster *ClusterFilterer) FilterPrintAll(opts *bind.FilterOpts) (*Cluster // WatchPrintAll is a free log subscription operation binding the contract event 0x3d030f7cce2619e90f621cb560eb4327f74d9a412c2daa8bed5a892d759187ec. // -// Solidity: e PrintAll(_orgId string, _privateKey string) +// Solidity: e PrintAll(_orgId string, _tmKey string) func (_Cluster *ClusterFilterer) WatchPrintAll(opts *bind.WatchOpts, sink chan<- *ClusterPrintAll) (event.Subscription, error) { logs, sub, err := _Cluster.contract.WatchLogs(opts, "PrintAll") @@ -1532,130 +1924,6 @@ func (_Cluster *ClusterFilterer) WatchPrintAll(opts *bind.WatchOpts, sink chan<- }), nil } -// ClusterPrintKeyIterator is returned from FilterPrintKey and is used to iterate over the raw logs and unpacked data for PrintKey events raised by the Cluster contract. -type ClusterPrintKeyIterator struct { - Event *ClusterPrintKey // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *ClusterPrintKeyIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(ClusterPrintKey) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(ClusterPrintKey) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *ClusterPrintKeyIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ClusterPrintKeyIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ClusterPrintKey represents a PrintKey event raised by the Cluster contract. -type ClusterPrintKey struct { - OrgId string - PendingOp uint8 - PendingKey string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterPrintKey is a free log retrieval operation binding the contract event 0x5ac991854acd1b6419820adc1e7485528b0ad28b55d18e070e9bcd63786e7ff8. -// -// Solidity: e PrintKey(_orgId string, _pendingOp uint8, _pendingKey string) -func (_Cluster *ClusterFilterer) FilterPrintKey(opts *bind.FilterOpts) (*ClusterPrintKeyIterator, error) { - - logs, sub, err := _Cluster.contract.FilterLogs(opts, "PrintKey") - if err != nil { - return nil, err - } - return &ClusterPrintKeyIterator{contract: _Cluster.contract, event: "PrintKey", logs: logs, sub: sub}, nil -} - -// WatchPrintKey is a free log subscription operation binding the contract event 0x5ac991854acd1b6419820adc1e7485528b0ad28b55d18e070e9bcd63786e7ff8. -// -// Solidity: e PrintKey(_orgId string, _pendingOp uint8, _pendingKey string) -func (_Cluster *ClusterFilterer) WatchPrintKey(opts *bind.WatchOpts, sink chan<- *ClusterPrintKey) (event.Subscription, error) { - - logs, sub, err := _Cluster.contract.WatchLogs(opts, "PrintKey") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ClusterPrintKey) - if err := _Cluster.contract.UnpackLog(event, "PrintKey", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - // ClusterPrintVoterIterator is returned from FilterPrintVoter and is used to iterate over the raw logs and unpacked data for PrintVoter events raised by the Cluster contract. type ClusterPrintVoterIterator struct { Event *ClusterPrintVoter // Event containing the contract specifics and raw log @@ -1779,9 +2047,9 @@ func (_Cluster *ClusterFilterer) WatchPrintVoter(opts *bind.WatchOpts, sink chan }), nil } -// ClusterVoterAccountDeletedIterator is returned from FilterVoterAccountDeleted and is used to iterate over the raw logs and unpacked data for VoterAccountDeleted events raised by the Cluster contract. -type ClusterVoterAccountDeletedIterator struct { - Event *ClusterVoterAccountDeleted // Event containing the contract specifics and raw log +// ClusterSubOrgAddedIterator is returned from FilterSubOrgAdded and is used to iterate over the raw logs and unpacked data for SubOrgAdded events raised by the Cluster contract. +type ClusterSubOrgAddedIterator struct { + Event *ClusterSubOrgAdded // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -1795,7 +2063,7 @@ type ClusterVoterAccountDeletedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *ClusterVoterAccountDeletedIterator) Next() bool { +func (it *ClusterSubOrgAddedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1804,7 +2072,7 @@ func (it *ClusterVoterAccountDeletedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ClusterVoterAccountDeleted) + it.Event = new(ClusterSubOrgAdded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1819,7 +2087,7 @@ func (it *ClusterVoterAccountDeletedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ClusterVoterAccountDeleted) + it.Event = new(ClusterSubOrgAdded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1835,42 +2103,41 @@ func (it *ClusterVoterAccountDeletedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ClusterVoterAccountDeletedIterator) Error() error { +func (it *ClusterSubOrgAddedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ClusterVoterAccountDeletedIterator) Close() error { +func (it *ClusterSubOrgAddedIterator) Close() error { it.sub.Unsubscribe() return nil } -// ClusterVoterAccountDeleted represents a VoterAccountDeleted event raised by the Cluster contract. -type ClusterVoterAccountDeleted struct { - OrgId string - Address common.Address - Raw types.Log // Blockchain specific contextual infos +// ClusterSubOrgAdded represents a SubOrgAdded event raised by the Cluster contract. +type ClusterSubOrgAdded struct { + OrgId string + Raw types.Log // Blockchain specific contextual infos } -// FilterVoterAccountDeleted is a free log retrieval operation binding the contract event 0x192eeefa7720f7067bcc0a3f5bbcc2941c417a8761ec8b795d2941f3b0d2be17. +// FilterSubOrgAdded is a free log retrieval operation binding the contract event 0xd734c07873f32f0735016e51dc718e21a48a3bec999d5be38cf3af363fbfedab. // -// Solidity: e VoterAccountDeleted(_orgId string, _address address) -func (_Cluster *ClusterFilterer) FilterVoterAccountDeleted(opts *bind.FilterOpts) (*ClusterVoterAccountDeletedIterator, error) { +// Solidity: e SubOrgAdded(_orgId string) +func (_Cluster *ClusterFilterer) FilterSubOrgAdded(opts *bind.FilterOpts) (*ClusterSubOrgAddedIterator, error) { - logs, sub, err := _Cluster.contract.FilterLogs(opts, "VoterAccountDeleted") + logs, sub, err := _Cluster.contract.FilterLogs(opts, "SubOrgAdded") if err != nil { return nil, err } - return &ClusterVoterAccountDeletedIterator{contract: _Cluster.contract, event: "VoterAccountDeleted", logs: logs, sub: sub}, nil + return &ClusterSubOrgAddedIterator{contract: _Cluster.contract, event: "SubOrgAdded", logs: logs, sub: sub}, nil } -// WatchVoterAccountDeleted is a free log subscription operation binding the contract event 0x192eeefa7720f7067bcc0a3f5bbcc2941c417a8761ec8b795d2941f3b0d2be17. +// WatchSubOrgAdded is a free log subscription operation binding the contract event 0xd734c07873f32f0735016e51dc718e21a48a3bec999d5be38cf3af363fbfedab. // -// Solidity: e VoterAccountDeleted(_orgId string, _address address) -func (_Cluster *ClusterFilterer) WatchVoterAccountDeleted(opts *bind.WatchOpts, sink chan<- *ClusterVoterAccountDeleted) (event.Subscription, error) { +// Solidity: e SubOrgAdded(_orgId string) +func (_Cluster *ClusterFilterer) WatchSubOrgAdded(opts *bind.WatchOpts, sink chan<- *ClusterSubOrgAdded) (event.Subscription, error) { - logs, sub, err := _Cluster.contract.WatchLogs(opts, "VoterAccountDeleted") + logs, sub, err := _Cluster.contract.WatchLogs(opts, "SubOrgAdded") if err != nil { return nil, err } @@ -1880,8 +2147,252 @@ func (_Cluster *ClusterFilterer) WatchVoterAccountDeleted(opts *bind.WatchOpts, select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ClusterVoterAccountDeleted) - if err := _Cluster.contract.UnpackLog(event, "VoterAccountDeleted", log); err != nil { + event := new(ClusterSubOrgAdded) + if err := _Cluster.contract.UnpackLog(event, "SubOrgAdded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ClusterSubOrgExistsIterator is returned from FilterSubOrgExists and is used to iterate over the raw logs and unpacked data for SubOrgExists events raised by the Cluster contract. +type ClusterSubOrgExistsIterator struct { + Event *ClusterSubOrgExists // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ClusterSubOrgExistsIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ClusterSubOrgExists) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ClusterSubOrgExists) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ClusterSubOrgExistsIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ClusterSubOrgExistsIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ClusterSubOrgExists represents a SubOrgExists event raised by the Cluster contract. +type ClusterSubOrgExists struct { + OrgId string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSubOrgExists is a free log retrieval operation binding the contract event 0x2b24431229489a8557abb42bd24fcf95defc95e5c1277f2b08c4860e7f62ee35. +// +// Solidity: e SubOrgExists(_orgId string) +func (_Cluster *ClusterFilterer) FilterSubOrgExists(opts *bind.FilterOpts) (*ClusterSubOrgExistsIterator, error) { + + logs, sub, err := _Cluster.contract.FilterLogs(opts, "SubOrgExists") + if err != nil { + return nil, err + } + return &ClusterSubOrgExistsIterator{contract: _Cluster.contract, event: "SubOrgExists", logs: logs, sub: sub}, nil +} + +// WatchSubOrgExists is a free log subscription operation binding the contract event 0x2b24431229489a8557abb42bd24fcf95defc95e5c1277f2b08c4860e7f62ee35. +// +// Solidity: e SubOrgExists(_orgId string) +func (_Cluster *ClusterFilterer) WatchSubOrgExists(opts *bind.WatchOpts, sink chan<- *ClusterSubOrgExists) (event.Subscription, error) { + + logs, sub, err := _Cluster.contract.WatchLogs(opts, "SubOrgExists") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ClusterSubOrgExists) + if err := _Cluster.contract.UnpackLog(event, "SubOrgExists", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ClusterSubOrgNotFoundIterator is returned from FilterSubOrgNotFound and is used to iterate over the raw logs and unpacked data for SubOrgNotFound events raised by the Cluster contract. +type ClusterSubOrgNotFoundIterator struct { + Event *ClusterSubOrgNotFound // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ClusterSubOrgNotFoundIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ClusterSubOrgNotFound) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ClusterSubOrgNotFound) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ClusterSubOrgNotFoundIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ClusterSubOrgNotFoundIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ClusterSubOrgNotFound represents a SubOrgNotFound event raised by the Cluster contract. +type ClusterSubOrgNotFound struct { + OrgId string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSubOrgNotFound is a free log retrieval operation binding the contract event 0xbdc2f111e14dcb54d9904c6194c792ff3d70aec9d1c642165aa04e89a28536cd. +// +// Solidity: e SubOrgNotFound(_orgId string) +func (_Cluster *ClusterFilterer) FilterSubOrgNotFound(opts *bind.FilterOpts) (*ClusterSubOrgNotFoundIterator, error) { + + logs, sub, err := _Cluster.contract.FilterLogs(opts, "SubOrgNotFound") + if err != nil { + return nil, err + } + return &ClusterSubOrgNotFoundIterator{contract: _Cluster.contract, event: "SubOrgNotFound", logs: logs, sub: sub}, nil +} + +// WatchSubOrgNotFound is a free log subscription operation binding the contract event 0xbdc2f111e14dcb54d9904c6194c792ff3d70aec9d1c642165aa04e89a28536cd. +// +// Solidity: e SubOrgNotFound(_orgId string) +func (_Cluster *ClusterFilterer) WatchSubOrgNotFound(opts *bind.WatchOpts, sink chan<- *ClusterSubOrgNotFound) (event.Subscription, error) { + + logs, sub, err := _Cluster.contract.WatchLogs(opts, "SubOrgNotFound") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ClusterSubOrgNotFound) + if err := _Cluster.contract.UnpackLog(event, "SubOrgNotFound", log); err != nil { return err } event.Raw = log @@ -2025,6 +2536,129 @@ func (_Cluster *ClusterFilterer) WatchVoterAdded(opts *bind.WatchOpts, sink chan }), nil } +// ClusterVoterDeletedIterator is returned from FilterVoterDeleted and is used to iterate over the raw logs and unpacked data for VoterDeleted events raised by the Cluster contract. +type ClusterVoterDeletedIterator struct { + Event *ClusterVoterDeleted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ClusterVoterDeletedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ClusterVoterDeleted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ClusterVoterDeleted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ClusterVoterDeletedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ClusterVoterDeletedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ClusterVoterDeleted represents a VoterDeleted event raised by the Cluster contract. +type ClusterVoterDeleted struct { + OrgId string + Address common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterVoterDeleted is a free log retrieval operation binding the contract event 0x654cd85d9b2abaf3affef0a047625d088e6e4d0448935c9b5016b5f5aa0ca3b6. +// +// Solidity: e VoterDeleted(_orgId string, _address address) +func (_Cluster *ClusterFilterer) FilterVoterDeleted(opts *bind.FilterOpts) (*ClusterVoterDeletedIterator, error) { + + logs, sub, err := _Cluster.contract.FilterLogs(opts, "VoterDeleted") + if err != nil { + return nil, err + } + return &ClusterVoterDeletedIterator{contract: _Cluster.contract, event: "VoterDeleted", logs: logs, sub: sub}, nil +} + +// WatchVoterDeleted is a free log subscription operation binding the contract event 0x654cd85d9b2abaf3affef0a047625d088e6e4d0448935c9b5016b5f5aa0ca3b6. +// +// Solidity: e VoterDeleted(_orgId string, _address address) +func (_Cluster *ClusterFilterer) WatchVoterDeleted(opts *bind.WatchOpts, sink chan<- *ClusterVoterDeleted) (event.Subscription, error) { + + logs, sub, err := _Cluster.contract.WatchLogs(opts, "VoterDeleted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ClusterVoterDeleted) + if err := _Cluster.contract.UnpackLog(event, "VoterDeleted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + // ClusterVoterExistsIterator is returned from FilterVoterExists and is used to iterate over the raw logs and unpacked data for VoterExists events raised by the Cluster contract. type ClusterVoterExistsIterator struct { Event *ClusterVoterExists // Event containing the contract specifics and raw log @@ -2270,126 +2904,3 @@ func (_Cluster *ClusterFilterer) WatchVoterNotFound(opts *bind.WatchOpts, sink c } }), nil } - -// ClusterOrgVoterAddedIterator is returned from FilterOrgVoterAdded and is used to iterate over the raw logs and unpacked data for OrgVoterAdded events raised by the Cluster contract. -type ClusterOrgVoterAddedIterator struct { - Event *ClusterOrgVoterAdded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *ClusterOrgVoterAddedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(ClusterOrgVoterAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(ClusterOrgVoterAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *ClusterOrgVoterAddedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ClusterOrgVoterAddedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ClusterOrgVoterAdded represents a OrgVoterAdded event raised by the Cluster contract. -type ClusterOrgVoterAdded struct { - OrgId string - VoterAccount string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOrgVoterAdded is a free log retrieval operation binding the contract event 0x29f608001a67850240567b3e8b7e23bcef793f113a446763600384c00899c04c. -// -// Solidity: e orgVoterAdded(_orgId string, _voterAccount string) -func (_Cluster *ClusterFilterer) FilterOrgVoterAdded(opts *bind.FilterOpts) (*ClusterOrgVoterAddedIterator, error) { - - logs, sub, err := _Cluster.contract.FilterLogs(opts, "orgVoterAdded") - if err != nil { - return nil, err - } - return &ClusterOrgVoterAddedIterator{contract: _Cluster.contract, event: "orgVoterAdded", logs: logs, sub: sub}, nil -} - -// WatchOrgVoterAdded is a free log subscription operation binding the contract event 0x29f608001a67850240567b3e8b7e23bcef793f113a446763600384c00899c04c. -// -// Solidity: e orgVoterAdded(_orgId string, _voterAccount string) -func (_Cluster *ClusterFilterer) WatchOrgVoterAdded(opts *bind.WatchOpts, sink chan<- *ClusterOrgVoterAdded) (event.Subscription, error) { - - logs, sub, err := _Cluster.contract.WatchLogs(opts, "orgVoterAdded") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ClusterOrgVoterAdded) - if err := _Cluster.contract.UnpackLog(event, "orgVoterAdded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} diff --git a/controls/cluster/Clusterkeys.sol b/controls/cluster/Clusterkeys.sol index a3dad7245..3956dd82a 100644 --- a/controls/cluster/Clusterkeys.sol +++ b/controls/cluster/Clusterkeys.sol @@ -7,20 +7,20 @@ contract Clusterkeys { struct OrgDetails { string orgId; string morgId; - string [] privateKey; + string [] tmKey; string pendingKey; Operation pendingOp; } OrgDetails [] private orgList; mapping(bytes32 => uint) private OrgIndex; - // Struct for managing the voter accounst for the org + // Struct for managing the voter accounst for the org struct MasterOrgDetails { string orgId; - address [] orgVoterAccount; - string [] privateKey; + address [] voterAccount; + string [] tmKey; } - MasterOrgDetails [] private morgList; + MasterOrgDetails [] private masterOrgList; mapping(bytes32 => uint) private MasterOrgIndex; // mapping to monitor the voting status for each acount and @@ -28,31 +28,41 @@ contract Clusterkeys { mapping (uint => mapping (address => bool)) private voteStatus; mapping (uint => uint) private voteCount; - uint private numberOfOrgs = 0; - uint private orgVoterNum = 0; + uint private orgNum = 0; + uint private morgNum = 0; + + // events related to Master Org add + event MasterOrgAdded(string _orgId); + event MasterOrgExists(string _orgId); + event MasterOrgNotFound(string _orgId); + + // events related to Sub Org add + event SubOrgAdded(string _orgId); + event SubOrgExists(string _orgId); + event SubOrgNotFound(string _orgId); // events related to Org level key management - event OrgKeyAdded(string _orgId, string _privateKey); - event OrgKeyDeleted(string _orgId, string _privateKey); - event KeyNotFound(string _privateKey); - event KeyExists(string _orgId, string _privateKey); + event OrgKeyAdded(string _orgId, string _tmKey); + event OrgKeyDeleted(string _orgId, string _tmKey); + event KeyNotFound(string _tmKey); + event KeyExists(string _orgId, string _tmKey); event OrgNotFound(string _orgId); // events related to org level approval process event PendingApproval(string _orgId); - event ItemForApproval(string _orgId, Operation _pendingOp, string _privateKey); + event ItemForApproval(string _orgId, Operation _pendingOp, string _tmKey); event NothingToApprove(string _orgId); // events related to managing voting accounts for the org event NoVotingAccount(string _orgId); event VoterAdded(string _orgId, address _address); event VoterNotFound(string _orgId, address _address); - event VoterAccountDeleted(string _orgId, address _address); + event VoterDeleted(string _orgId, address _address); event VoterExists(string _orgId, address _address); // events related to helper functions to print all org keys and voter keys - /* event PrintAll(string _orgId, string _privateKey); */ - /* event PrintVoter(string _orgId, address _voterAccount); */ + event PrintAll(string _orgId, string _tmKey); + event PrintVoter(string _orgId, address _voterAccount); // returns the org index for the org list function getOrgIndex(string _orgId) internal view returns (uint) @@ -61,7 +71,7 @@ contract Clusterkeys { } // returns the voter index for the org from voter list - function getMasterIndex(string _orgId) internal view returns (uint) + function getMasterOrgIndex(string _orgId) internal view returns (uint) { return MasterOrgIndex[keccak256(abi.encodePacked(_orgId))] - 1; } @@ -70,9 +80,9 @@ contract Clusterkeys { modifier canVote(string _orgId){ bool flag = false; uint orgIndex = getOrgIndex(_orgId); - uint morgIndex = getMasterIndex(orgList[orgIndex].morgId); - for (uint i = 0; i < morgList[morgIndex].orgVoterAccount.length; i++){ - if ( morgList[morgIndex].orgVoterAccount[i] == msg.sender){ + uint vorgIndex = getMasterOrgIndex(orgList[orgIndex].morgId); + for (uint i = 0; i < masterOrgList[vorgIndex].voterAccount.length; i++){ + if ( masterOrgList[vorgIndex].voterAccount[i] == msg.sender){ flag = true; break; } @@ -82,12 +92,11 @@ contract Clusterkeys { } // checks if the org has any voter accounts set up or not - function checkIfVoterExists(string _orgId, address _address) internal view returns (bool, uint){ + function checkIfVoterExists(string _morgId, address _address) internal view returns (bool, uint){ bool keyExists = false; - uint orgIndex = getOrgIndex(_orgId); - uint voterIndex = getMasterIndex(orgList[orgIndex].morgId); - for (uint i = 0; i < morgList[voterIndex].orgVoterAccount.length; i++){ - if(keccak256(abi.encodePacked(morgList[voterIndex].orgVoterAccount[i])) == keccak256(abi.encodePacked(_address))){ + uint voterIndex = getMasterOrgIndex(_morgId); + for (uint i = 0; i < masterOrgList[voterIndex].voterAccount.length; i++){ + if(keccak256(abi.encodePacked(masterOrgList[voterIndex].voterAccount[i])) == keccak256(abi.encodePacked(_address))){ keyExists = true; break; } @@ -98,14 +107,9 @@ contract Clusterkeys { // checks if the voter account is already in the voter accounts list for the org function checkVotingAccountExists(string _orgId) internal returns (bool) { - uint orgIndex = getOrgIndex(_orgId); - if (MasterOrgIndex[keccak256(abi.encodePacked(orgList[orgIndex].morgId))] == 0){ - emit NoVotingAccount(_orgId); - return false; - } - uint morgIndex = getMasterIndex(orgList[orgIndex].morgId); - if (morgList[morgIndex].orgVoterAccount.length == 0) { + uint vorgIndex = getMasterOrgIndex(orgList[orgIndex].morgId); + if (masterOrgList[vorgIndex].voterAccount.length == 0) { emit NoVotingAccount(_orgId); return false; } @@ -126,140 +130,158 @@ contract Clusterkeys { } // checks if there the key is already in the list of private keys for the org - function checkIfKeyExists(string _orgId, string _privateKey) internal view returns (bool, uint){ + function checkIfKeyExists(string _orgId, string _tmKey) internal view returns (bool, uint){ bool keyExists = false; uint orgIndex = getOrgIndex(_orgId); - for (uint i = 0; i < orgList[orgIndex].privateKey.length; i++){ - if(keccak256(abi.encodePacked(orgList[orgIndex].privateKey[i])) == keccak256(abi.encodePacked(_privateKey))){ + for (uint i = 0; i < orgList[orgIndex].tmKey.length; i++){ + if(keccak256(abi.encodePacked(orgList[orgIndex].tmKey[i])) == keccak256(abi.encodePacked(_tmKey))){ keyExists = true; break; } } return (keyExists, i); } + // function to check if morg exists + function checkMasterOrgExists (string _morgId) external view returns (bool) { + if (MasterOrgIndex[keccak256(abi.encodePacked(_morgId))] == 0) { + return false; + } + else { + return true; + } + } + // function for adding a new master org + function addMasterOrg(string _morgId) external + { + morgNum++; + MasterOrgIndex[keccak256(abi.encodePacked(_morgId))] = morgNum; + masterOrgList.push( MasterOrgDetails(_morgId, new address[](0), new string[](0))); + emit MasterOrgAdded(_morgId); + } // function for adding a voter account to a master org - function addVoter(string _orgId, address _address) external + function addVoter(string _morgId, address _address) external { - if (MasterOrgIndex[keccak256(abi.encodePacked(_orgId))] == 0) { - orgVoterNum++; - MasterOrgIndex[keccak256(abi.encodePacked(_orgId))] = orgVoterNum; - morgList.push( MasterOrgDetails(_orgId, new address[](0), new string[](0))); - morgList[orgVoterNum - 1].orgVoterAccount.push(_address); - emit VoterAdded(_orgId, _address); + if (MasterOrgIndex[keccak256(abi.encodePacked(_morgId))] == 0) { + emit MasterOrgNotFound(_morgId); } else { bool voterExists = false; uint i = 0; - (voterExists, i) = checkIfVoterExists(_orgId, _address); + (voterExists, i) = checkIfVoterExists(_morgId, _address); if (voterExists) { - emit VoterExists(_orgId, _address); + emit VoterExists(_morgId, _address); } else { - uint voterIndex = getMasterIndex(_orgId); - morgList[voterIndex].orgVoterAccount.push(_address); - emit VoterAdded(_orgId, _address); + uint morgIndex = getMasterOrgIndex(_morgId); + masterOrgList[morgIndex].voterAccount.push(_address); + emit VoterAdded(_morgId, _address); } } } // function for deleting a voter account to a master org - function deleteVoter(string _orgId, address _address) external + function deleteVoter(string _morgId, address _address) external { - if (MasterOrgIndex[keccak256(abi.encodePacked(_orgId))] == 0) { - emit OrgNotFound(_orgId); + if (MasterOrgIndex[keccak256(abi.encodePacked(_morgId))] == 0) { + emit MasterOrgNotFound(_morgId); + } + uint morgIndex = getMasterOrgIndex(_morgId); + (bool voterExists, uint i) = checkIfVoterExists(_morgId, _address); + + if (voterExists == true) { + for (uint j = i; j < masterOrgList[morgIndex].voterAccount.length -1; j++){ + masterOrgList[morgIndex].voterAccount[j] = masterOrgList[morgIndex].voterAccount[j+1]; + } + delete masterOrgList[morgIndex].voterAccount[masterOrgList[morgIndex].voterAccount.length -1]; + masterOrgList[morgIndex].voterAccount.length --; + emit VoterDeleted(_morgId, _address); } else { - uint voterIndex = getMasterIndex(_orgId); - (bool voterExists, uint i) = checkIfVoterExists(_orgId, _address); + emit VoterNotFound(_morgId, _address); + } + } - if (voterExists == true) { - for (uint j = i; j < morgList[voterIndex].orgVoterAccount.length -1; j++){ - morgList[voterIndex].orgVoterAccount[j] = morgList[voterIndex].orgVoterAccount[j+1]; - } - delete morgList[voterIndex].orgVoterAccount[morgList[voterIndex].orgVoterAccount.length -1]; - morgList[voterIndex].orgVoterAccount.length --; - emit VoterAccountDeleted(_orgId, _address); + // function for adding a new master org + function addSubOrg(string _orgId, string _morgId) external + { + // check if master org exists + if (MasterOrgIndex[keccak256(abi.encodePacked(_morgId))] == 0){ + emit MasterOrgNotFound(_morgId); + } + else { + if (OrgIndex[keccak256(abi.encodePacked(_orgId))] == 0) { + orgNum++; + OrgIndex[keccak256(abi.encodePacked(_orgId))] = orgNum; + orgList.push( OrgDetails(_orgId, _morgId, new string[](0), new string(0), Operation.None )); + emit SubOrgAdded(_morgId); } else { - emit VoterNotFound(_orgId, _address); + emit SubOrgExists(_morgId); } } } - // function to create master org - function addMasterOrg(string _orgId) external - { - require (MasterOrgIndex[keccak256(abi.encodePacked(_orgId))] == 0); - - + // function for checking if org exists and if there are any pending ops + function checkOrgPendingOp (string _orgId) internal returns (bool) { + if (OrgIndex[keccak256(abi.encodePacked(_orgId))] == 0) { + emit OrgNotFound(_orgId); + return false; + } + if (checkVotingAccountExists(_orgId)){ + if (checkingPendingOp(_orgId)){ + emit PendingApproval(_orgId); + return false; + } + } + else { + emit NoVotingAccount(_orgId); + return false; + } + return true; } // function for adding a private key for the org. Thsi will be added once // approval process is complete - function addOrgKey(string _orgId, string _morgId, string _privateKey) external + function addOrgKey(string _orgId, string _tmKey) external { - if (checkVotingAccountExists(_orgId)){ - if (OrgIndex[keccak256(abi.encodePacked(_orgId))] == 0) { - numberOfOrgs++; - OrgIndex[keccak256(abi.encodePacked(_orgId))] = numberOfOrgs; - orgList.push( OrgDetails(_orgId, _morgId, new string[](0), _privateKey, Operation.Add)); - voterInit(_orgId); - emit ItemForApproval(_orgId, Operation.Add, _privateKey); + bool ret = checkOrgPendingOp(_orgId); + if (ret){ + bool keyExists = false; + uint i = 0; + (keyExists, i) = checkIfKeyExists(_orgId, _tmKey); + if (keyExists) { + emit KeyExists(_orgId, _tmKey); } else { - if (checkingPendingOp(_orgId)){ - emit PendingApproval(_orgId); - } - else { - bool keyExists = false; - uint i = 0; - (keyExists, i) = checkIfKeyExists(_orgId, _privateKey); - if (keyExists) { - emit KeyExists(_orgId, _privateKey); - } - else { - uint orgIndex; - orgIndex = getOrgIndex(_orgId); - orgList[orgIndex].pendingKey = _privateKey; - orgList[orgIndex].pendingOp = Operation.Add; - voterInit(_orgId); - emit ItemForApproval(_orgId,Operation.Add, _privateKey); - } - } + uint orgIndex; + orgIndex = getOrgIndex(_orgId); + orgList[orgIndex].pendingKey = _tmKey; + orgList[orgIndex].pendingOp = Operation.Add; + voterInit(_orgId); + emit ItemForApproval(_orgId,Operation.Add, _tmKey); } } } // function for deleting a private key for the org. Thsi will be deleted once // approval process is complete - function deleteOrgKey(string _orgId, string _privateKey) external + function deleteOrgKey(string _orgId, string _tmKey) external { - if (checkVotingAccountExists(_orgId)){ - if (OrgIndex[keccak256(abi.encodePacked(_orgId))] == 0) { - emit OrgNotFound(_orgId); + bool ret = checkOrgPendingOp(_orgId); + if(ret) { + uint orgIndex = getOrgIndex(_orgId); + uint i = 0; + bool keyExists = false; + (keyExists, i) = checkIfKeyExists (_orgId, _tmKey); + if (keyExists == true) { + orgList[orgIndex].pendingKey = _tmKey; + orgList[orgIndex].pendingOp = Operation.Delete; + voterInit(_orgId); + emit ItemForApproval(_orgId, Operation.Delete, _tmKey); } else { - if (checkingPendingOp(_orgId)){ - emit PendingApproval(_orgId); - } - else { - uint orgIndex = getOrgIndex(_orgId); - uint i = 0; - bool keyExists = false; - - (keyExists, i) = checkIfKeyExists (_orgId, _privateKey); - if (keyExists == true) { - orgList[orgIndex].pendingKey = _privateKey; - orgList[orgIndex].pendingOp = Operation.Delete; - voterInit(_orgId); - emit ItemForApproval(_orgId, Operation.Delete, _privateKey); - - } - else { - emit KeyNotFound(_privateKey); - } - } + emit KeyNotFound(_tmKey); } } } @@ -281,14 +303,14 @@ contract Clusterkeys { // new item is initiated for approval function voterInit(string _orgId) internal { uint orgIndex = getOrgIndex(_orgId); - uint morgIndex = getMasterIndex(orgList[orgIndex].morgId); - for (uint i = 0; i < morgList[morgIndex].orgVoterAccount.length; i++){ - voteStatus[orgIndex][morgList[morgIndex].orgVoterAccount[i]] = false; + uint vorgIndex = getMasterOrgIndex(orgList[orgIndex].morgId); + for (uint i = 0; i < masterOrgList[vorgIndex].voterAccount.length; i++){ + voteStatus[orgIndex][masterOrgList[vorgIndex].voterAccount[i]] = false; } voteCount[orgIndex] = 0; } - // processes the vote from the voter account. + // processes the vote from the voter account. function processVote (string _orgId) internal { uint orgIndex = getOrgIndex(_orgId); if (voteStatus[orgIndex][msg.sender] == false ){ @@ -301,7 +323,7 @@ contract Clusterkeys { // returns true function checkEnoughVotes (string _orgId) internal view returns (bool) { uint orgIndex = getOrgIndex(_orgId); - if (voteCount[orgIndex] > morgList[orgIndex].orgVoterAccount.length / 2 ){ + if (voteCount[orgIndex] > masterOrgList[orgIndex].voterAccount.length / 2 ){ return true; } return false; @@ -314,8 +336,8 @@ contract Clusterkeys { continue; } if (keccak256(abi.encodePacked(orgList[i].morgId)) == keccak256(abi.encodePacked(_morgId))){ - for (uint j = 0; j < orgList[i].privateKey.length; j++){ - if (keccak256(abi.encodePacked(orgList[i].privateKey[j])) == keccak256(abi.encodePacked(_key))){ + for (uint j = 0; j < orgList[i].tmKey.length; j++){ + if (keccak256(abi.encodePacked(orgList[i].tmKey[j])) == keccak256(abi.encodePacked(_key))){ keyInUse = true; break; } @@ -329,18 +351,18 @@ contract Clusterkeys { } // updates the master keys list with the key being added or deleted function masterKeyUpdate(string _orgId, string _morgId, string _key, Operation _op) internal { - uint morgIndex = getMasterIndex(_morgId); + uint morgIndex = getMasterOrgIndex(_morgId); if (_op == Operation.Add) { // check if the key is existing. if yes ignore else add to master list bool keyExists = false; - for (uint i = 0; i < morgList[morgIndex].privateKey.length; i++){ - if(keccak256(abi.encodePacked(orgList[morgIndex].privateKey[i])) == keccak256(abi.encodePacked(_key))){ + for (uint i = 0; i < masterOrgList[morgIndex].tmKey.length; i++){ + if(keccak256(abi.encodePacked(masterOrgList[morgIndex].tmKey[i])) == keccak256(abi.encodePacked(_key))){ keyExists = true; break; } } if (keyExists == false ){ - morgList[morgIndex].privateKey.push(_key); + masterOrgList[morgIndex].tmKey.push(_key); } } else { @@ -348,16 +370,16 @@ contract Clusterkeys { // key in the private keys if (!(checkKeyInUse(_orgId, _morgId, _key))){ uint index; - for (index = 0; i < morgList[morgIndex].privateKey.length; index++) { - if(keccak256(abi.encodePacked(morgList[morgIndex].privateKey[index])) == keccak256(abi.encodePacked(_key))) { + for (index = 0; i < masterOrgList[morgIndex].tmKey.length; index++) { + if(keccak256(abi.encodePacked(masterOrgList[morgIndex].tmKey[index])) == keccak256(abi.encodePacked(_key))) { break; } } - for (uint j = index; j < morgList[morgIndex].privateKey.length -1; j++){ - morgList[morgIndex].privateKey[j] = morgList[morgIndex].privateKey[j+1]; + for (uint j = index; j < masterOrgList[morgIndex].tmKey.length -1; j++){ + masterOrgList[morgIndex].tmKey[j] = masterOrgList[morgIndex].tmKey[j+1]; } - delete morgList[morgIndex].privateKey[morgList[morgIndex].privateKey.length -1]; - morgList[morgIndex].privateKey.length --; + delete masterOrgList[morgIndex].tmKey[masterOrgList[morgIndex].tmKey.length -1]; + masterOrgList[morgIndex].tmKey.length --; } } } @@ -367,7 +389,7 @@ contract Clusterkeys { if(checkEnoughVotes(orgList[_orgIndex].orgId)){ string storage locKey = orgList[_orgIndex].pendingKey; if (orgList[_orgIndex].pendingOp == Operation.Add){ - orgList[_orgIndex].privateKey.push(orgList[_orgIndex].pendingKey); + orgList[_orgIndex].tmKey.push(orgList[_orgIndex].pendingKey); masterKeyUpdate(orgList[_orgIndex].orgId, orgList[_orgIndex].morgId, orgList[_orgIndex].pendingKey, Operation.Add); emit OrgKeyAdded(orgList[_orgIndex].orgId, locKey); } @@ -375,11 +397,11 @@ contract Clusterkeys { bool keyExists = false; uint i = 0; (keyExists, i) = checkIfKeyExists (orgList[_orgIndex].orgId, locKey); - for (uint j = i; j < orgList[_orgIndex].privateKey.length -1; j++){ - orgList[_orgIndex].privateKey[j] = orgList[_orgIndex].privateKey[j+1]; + for (uint j = i; j < orgList[_orgIndex].tmKey.length -1; j++){ + orgList[_orgIndex].tmKey[j] = orgList[_orgIndex].tmKey[j+1]; } - delete orgList[_orgIndex].privateKey[orgList[_orgIndex].privateKey.length -1]; - orgList[_orgIndex].privateKey.length --; + delete orgList[_orgIndex].tmKey[orgList[_orgIndex].tmKey.length -1]; + orgList[_orgIndex].tmKey.length --; masterKeyUpdate(orgList[_orgIndex].orgId, orgList[_orgIndex].morgId, orgList[_orgIndex].pendingKey, Operation.Delete); emit OrgKeyDeleted(orgList[_orgIndex].orgId, locKey); } @@ -387,23 +409,4 @@ contract Clusterkeys { orgList[_orgIndex].pendingKey = ""; } } - - /* // helper function to print all privates keys for an org */ - /* function printAllOrg () public { */ - /* for (uint i = 0; i < orgList.length; i++){ */ - /* for (uint j = 0; j < orgList[i].privateKey.length ; j++){ */ - /* emit PrintAll(orgList[i].orgId, orgList[i].privateKey[j]); */ - /* } */ - /* } */ - /* } */ - - /* // helper function to print all voters accounts for an org */ - /* function printAllVoter () public { */ - /* for (uint i = 0; i < morgList.length; i++){ */ - /* for (uint j = 0; j < morgList[i].orgVoterAccount.length ; j++){ */ - /* emit PrintVoter(morgList[i].orgId, morgList[i].orgVoterAccount[j]); */ - /* } */ - /* } */ - /* } */ - } diff --git a/controls/cluster/abi/Clusterkeys.abi b/controls/cluster/abi/Clusterkeys.abi index 53bf8b327..d3af9272e 100644 --- a/controls/cluster/abi/Clusterkeys.abi +++ b/controls/cluster/abi/Clusterkeys.abi @@ -1 +1 @@ -[{"constant":false,"inputs":[],"name":"printAllOrg","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"}],"name":"approvePendingOp","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"},{"name":"_morgId","type":"string"},{"name":"_privateKey","type":"string"}],"name":"addOrgKey","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"},{"name":"_privateKey","type":"string"}],"name":"deleteOrgKey","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"},{"name":"_address","type":"address"}],"name":"addVoter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"},{"name":"_address","type":"address"}],"name":"deleteVoter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"printAllVoter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_privateKey","type":"string"}],"name":"OrgKeyAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_privateKey","type":"string"}],"name":"OrgKeyDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_privateKey","type":"string"}],"name":"KeyNotFound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_privateKey","type":"string"}],"name":"KeyExists","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"OrgNotFound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"PendingApproval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_pendingOp","type":"uint8"},{"indexed":false,"name":"_privateKey","type":"string"}],"name":"ItemForApproval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"NothingToApprove","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"NoVotingAccount","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_address","type":"address"}],"name":"VoterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_address","type":"address"}],"name":"VoterNotFound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_address","type":"address"}],"name":"VoterAccountDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_address","type":"address"}],"name":"VoterExists","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_privateKey","type":"string"}],"name":"PrintAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_voterAccount","type":"address"}],"name":"PrintVoter","type":"event"}] \ No newline at end of file +[{"constant":false,"inputs":[{"name":"_orgId","type":"string"},{"name":"_morgId","type":"string"}],"name":"addSubOrg","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"}],"name":"approvePendingOp","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"},{"name":"_tmKey","type":"string"}],"name":"deleteOrgKey","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_morgId","type":"string"},{"name":"_address","type":"address"}],"name":"addVoter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_morgId","type":"string"},{"name":"_address","type":"address"}],"name":"deleteVoter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_morgId","type":"string"}],"name":"addMasterOrg","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"},{"name":"_tmKey","type":"string"}],"name":"addOrgKey","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_morgId","type":"string"}],"name":"checkMasterOrgExists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"MasterOrgAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"MasterOrgExists","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"MasterOrgNotFound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"SubOrgAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"SubOrgExists","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"SubOrgNotFound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_tmKey","type":"string"}],"name":"OrgKeyAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_tmKey","type":"string"}],"name":"OrgKeyDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_tmKey","type":"string"}],"name":"KeyNotFound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_tmKey","type":"string"}],"name":"KeyExists","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"OrgNotFound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"PendingApproval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_pendingOp","type":"uint8"},{"indexed":false,"name":"_tmKey","type":"string"}],"name":"ItemForApproval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"NothingToApprove","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"NoVotingAccount","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_address","type":"address"}],"name":"VoterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_address","type":"address"}],"name":"VoterNotFound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_address","type":"address"}],"name":"VoterDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_address","type":"address"}],"name":"VoterExists","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_tmKey","type":"string"}],"name":"PrintAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_voterAccount","type":"address"}],"name":"PrintVoter","type":"event"}] \ No newline at end of file diff --git a/controls/cluster/abi/Clusterkeys.bin-runtime b/controls/cluster/abi/Clusterkeys.bin-runtime index 3d9e50001..67dbbcf0e 100644 --- a/controls/cluster/abi/Clusterkeys.bin-runtime +++ b/controls/cluster/abi/Clusterkeys.bin-runtime @@ -1 +1 @@ -6080604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632bbc5084811461008757806335dc47721461009e57806337c5345e146100be57806349379c50146100f65780635607395b1461012257806359cbd6fe1461015057806373f9cee01461017e575b600080fd5b34801561009357600080fd5b5061009c610193565b005b3480156100aa57600080fd5b5061009c6004803560248101910135610364565b3480156100ca57600080fd5b5061009c6024600480358281019290820135918135808301929082013591604435918201910135610681565b34801561010257600080fd5b5061009c6024600480358281019290820135918135918201910135610d46565b34801561012e57600080fd5b5061009c6024600480358281019291013590600160a060020a03903516611152565b34801561015c57600080fd5b5061009c6024600480358281019291013590600160a060020a039035166115eb565b34801561018a57600080fd5b5061009c6119c6565b6000805b600054821015610360575060005b60008054839081106101b357fe5b906000526020600020906005020160020180549050811015610355577f3d030f7cce2619e90f621cb560eb4327f74d9a412c2daa8bed5a892d759187ec6000838154811015156101ff57fe5b906000526020600020906005020160000160008481548110151561021f57fe5b90600052602060002090600502016002018381548110151561023d57fe5b60009182526020918290206040805181815285546002600182161561010002600019019091160491810182905292909101928291908201906060830190869080156102c95780601f1061029e576101008083540402835291602001916102c9565b820191906000526020600020905b8154815290600101906020018083116102ac57829003601f168201915b505083810382528454600260001961010060018416150201909116048082526020909101908590801561033d5780601f106103125761010080835404028352916020019161033d565b820191906000526020600020905b81548152906001019060200180831161032057829003601f168201915b505094505050505060405180910390a16001016101a5565b600190910190610197565b5050565b600082828080601f01602080910402602001604051908101604052809392919081815260200183838082843750600094508493508392508291506103a9905085611b28565b925061046c6000848154811015156103bd57fe5b90600052602060002090600502016001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104625780601f1061043757610100808354040283529160200191610462565b820191906000526020600020905b81548152906001019060200180831161044557829003601f168201915b5050505050611c0a565b9150600090505b600280548390811061048157fe5b9060005260206000209060030201600101805490508110156104f85760028054339190849081106104ae57fe5b9060005260206000209060030201600101828154811015156104cc57fe5b600091825260209091200154600160a060020a031614156104f057600193506104f8565b600101610473565b83151561056657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4163636f756e742063616e6e6f7420766f746500000000000000000000000000604482015290519081900360640190fd5b61059f88888080601f01602080910402602001604051908101604052809392919081815260200183838082843750611c44945050505050565b15610626576105dd88888080601f01602080910402602001604051908101604052809392919081815260200183838082843750611b28945050505050565b955061061888888080601f01602080910402602001604051908101604052809392919081815260200183838082843750611d82945050505050565b61062186611dee565b610677565b7fe820171ad1d64f6ca44bb0943acbac4c6085812bf91e8b79164629563980622888886040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a15b5050505050505050565b60008060006106bf89898080601f01602080910402602001604051908101604052809392919081815260200183838082843750612968945050505050565b15610d3b57600160008a8a604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b6020831061071e5780518252601f1990920191602091820191016106ff565b51815160209384036101000a600019018019909216911617905260408051929094018290039091208652850195909552929092016000205415159250610a5291505057600680546001908101918290556040516000908c908c90602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b602083106107c95780518252601f1990920191602091820191016107aa565b51815160209384036101000a600019018019909216911617905260408051929094018290039091208652858101969096525092830160009081209590955550508051601f8c01839004909202820160c090810190915260a082018b815282918d908d9081908501838280828437820191505050505050815260200189898080601f01602080910402602001604051908101604052809392919081815260200183838082843750505092845250506040805160008082526020828101909352919093019291506108a8565b60608152602001906001900390816108935790505b50815260200187878080601f01602080910402602001604051908101604052809392919081815260200183838082843750505092845250506001602092830181905284549081018086556000958652948390208451805160059093029091019361091793508492910190613d13565b5060208281015180516109309260018501920190613d13565b506040820151805161094c916002840191602090910190613d91565b5060608201518051610968916003840191602090910190613d13565b50608082015160048201805460ff1916600183600281111561098657fe5b02179055505050506109c789898080601f01602080910402602001604051908101604052809392919081815260200183838082843750612bc8945050505050565b7f4475befcee492797e02530076fd7e138aa058eb3bcd028a9df5c0f2815ba9f4a8989600188886040518080602001856002811115610a0257fe5b60ff168152602001806020018381038352888882818152602001925080828437909101848103835285815260200190508585808284376040519201829003995090975050505050505050a1610d3b565b610a8b89898080601f01602080910402602001604051908101604052809392919081815260200183838082843750611c44945050505050565b15610ae5577f2de31d28953221328a1c7e30a93fa15e0d8573128a8f6fa92cf66408a0403c9989896040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a1610d3b565b6000925060009150610b5489898080601f0160208091040260200160405190810160405280939291908181526020018383808284375050604080516020601f8d018190048102820181019092528b815294508b93508a9250829150840183828082843750612ca8945050505050565b90935091508215610bd3577ffd2bb3c1cfc78c051cb1f0ed88147fb9348eba128a594dc66fbf35dc63fe692d8989878760405180806020018060200183810383528787828181526020019250808284379091018481038352858152602001905085858082843760405192018290039850909650505050505050a1610d3b565b610c0c89898080601f01602080910402602001604051908101604052809392919081815260200183838082843750611b28945050505050565b90508484600083815481101515610c1f57fe5b90600052602060002090600502016003019190610c3d929190613dea565b506001600082815481101515610c4f57fe5b60009182526020909120600460059092020101805460ff19166001836002811115610c7657fe5b0217905550610cb489898080601f01602080910402602001604051908101604052809392919081815260200183838082843750612bc8945050505050565b7f4475befcee492797e02530076fd7e138aa058eb3bcd028a9df5c0f2815ba9f4a8989600188886040518080602001856002811115610cef57fe5b60ff168152602001806020018381038352888882818152602001925080828437909101848103835285815260200190508585808284376040519201829003995090975050505050505050a15b505050505050505050565b6000806000610d8487878080601f01602080910402602001604051908101604052809392919081815260200183838082843750612968945050505050565b1561114957600160008888604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310610de35780518252601f199092019160209182019101610dc4565b51815160209384036101000a600019018019909216911617905260408051929094018290039091208652850195909552929092016000205415159250610e7b915050577f0d426160118ead0b6900081fd1f08b0d9b626bd033ddd50cd7d24be253e11a8387876040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a1611149565b610eb487878080601f01602080910402602001604051908101604052809392919081815260200183838082843750611c44945050505050565b15610f0e577f2de31d28953221328a1c7e30a93fa15e0d8573128a8f6fa92cf66408a0403c9987876040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a1611149565b610f4787878080601f01602080910402602001604051908101604052809392919081815260200183838082843750611b28945050505050565b92506000915060009050610fb887878080601f0160208091040260200160405190810160405280939291908181526020018383808284375050604080516020601f8d018190048102820181019092528b815294508b93508a9250829150840183828082843750612ca8945050505050565b92509050600181151514156110f8578484600085815481101515610fd857fe5b90600052602060002090600502016003019190610ff6929190613dea565b50600260008481548110151561100857fe5b60009182526020909120600460059092020101805460ff1916600183600281111561102f57fe5b021790555061106d87878080601f01602080910402602001604051908101604052809392919081815260200183838082843750612bc8945050505050565b7f4475befcee492797e02530076fd7e138aa058eb3bcd028a9df5c0f2815ba9f4a87876002888860405180806020018560028111156110a857fe5b60ff168152602001806020018381038352888882818152602001925080828437909101848103835285815260200190508585808284376040519201829003995090975050505050505050a1611149565b7f1625cf45f71f82c8ccf66926c15856f85b1e08dbe285065512100db776fdeb2885856040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a15b50505050505050565b6000806000600360008787604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b602083106111b15780518252601f199092019160209182019101611192565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120865285019590955292909201600020541515925061144091505057600780546001019081905560405160039060009089908990602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b6020831061125d5780518252601f19909201916020918201910161123e565b51815160209384036101000a600019018019909216911617905260408051929094018290039091208652858101969096525092830160002094909455508051601f890183900490920282016080908101909152606082018881526002935082918a908a9081908501838280828437505050928452505060408051600080825260208083018452808601929092528251818152918201835291909301929150611315565b60608152602001906001900390816113005790505b509052815460018101808455600093845260209384902083518051929560039094029091019261134a92849290910190613d13565b5060208281015180516113639260018501920190613e58565b506040820151805161137f916002840191602090910190613d91565b50505050600260016007540381548110151561139757fe5b600091825260208083206001600390930201820180549283018155835291829020018054600160a060020a03871673ffffffffffffffffffffffffffffffffffffffff199091168117909155604080519283019190915280825281018690527f424f3ad05c61ea35cad66f22b70b1fad7250d8229921238078c401db36d345749087908790879080606081018585808284376040519201829003965090945050505050a16115e3565b600092506000915061148386868080601f016020809104026020016040519081016040528093929190818152602001838380828437508a9450612ed99350505050565b909350915082156114f45760408051600160a060020a03861660208201528181529081018690527f57c0436fcca42a02516ed36a118ab7196a853b19ae03db4cbe9d1f6ec5a8f30b9087908790879080606081018585808284376040519201829003965090945050505050a16115e3565b61152d86868080601f01602080910402602001604051908101604052809392919081815260200183838082843750611c0a945050505050565b905060028181548110151561153e57fe5b600091825260208083206001600390930201820180549283018155835291829020018054600160a060020a03871673ffffffffffffffffffffffffffffffffffffffff199091168117909155604080519283019190915280825281018690527f424f3ad05c61ea35cad66f22b70b1fad7250d8229921238078c401db36d345749087908790879080606081018585808284376040519201829003965090945050505050a15b505050505050565b600080600080600360008888604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b6020831061164b5780518252601f19909201916020918201910161162c565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912086528501959095529290920160002054151592506116e3915050577f0d426160118ead0b6900081fd1f08b0d9b626bd033ddd50cd7d24be253e11a8387876040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a1611149565b61171c87878080601f01602080910402602001604051908101604052809392919081815260200183838082843750611c0a945050505050565b935061175987878080601f016020809104026020016040519081016040528093929190818152602001838380828437508b9450612ed99350505050565b90935091506001831515141561195c5750805b600160028581548110151561177d57fe5b9060005260206000209060030201600101805490500381101561184b5760028054859081106117a857fe5b9060005260206000209060030201600101816001018154811015156117c957fe5b60009182526020909120015460028054600160a060020a0390921691869081106117ef57fe5b90600052602060002090600302016001018281548110151561180d57fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560010161176c565b600280548590811061185957fe5b9060005260206000209060030201600101600160028681548110151561187b57fe5b9060005260206000209060030201600101805490500381548110151561189d57fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916905560028054859081106118d157fe5b90600052602060002090600302016001018054809190600190036118f59190613ec6565b5060408051600160a060020a03871660208201528181529081018790527f192eeefa7720f7067bcc0a3f5bbcc2941c417a8761ec8b795d2941f3b0d2be179088908890889080606081018585808284376040519201829003965090945050505050a1611149565b60408051600160a060020a03871660208201528181529081018790527ffc25f65937d1cb43a570fb3b3c5d0bf0b69b4cdd2da44c56b9893e2d140359609088908890889080606081018585808284376040519201829003965090945050505050a150505050505050565b6000805b600254821015610360575060005b60028054839081106119e657fe5b906000526020600020906003020160010180549050811015611b1d577f0c0001a7636c2b95d29de23e25bb65060f9ad324f9f38b309f6f5659a6cb3165600283815481101515611a3257fe5b9060005260206000209060030201600001600284815481101515611a5257fe5b906000526020600020906003020160010183815481101515611a7057fe5b6000918252602091829020015460408051600160a060020a039092169282018390528082528354600260001960018316156101000201909116049082018190528190606082019085908015611b065780601f10611adb57610100808354040283529160200191611b06565b820191906000526020600020905b815481529060010190602001808311611ae957829003601f168201915b5050935050505060405180910390a16001016119d8565b6001909101906119ca565b60006001806000846040516020018082805190602001908083835b60208310611b625780518252601f199092019160209182019101611b43565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310611bc55780518252601f199092019160209182019101611ba6565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120865285019590955292909201600020549390930395945050505050565b60006001600360008460405160200180828051906020019080838360208310611b625780518252601f199092019160209182019101611b43565b60008060016000846040516020018082805190602001908083835b60208310611c7e5780518252601f199092019160209182019101611c5f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310611ce15780518252601f199092019160209182019101611cc2565b51815160209384036101000a600019018019909216911617905260408051929094018290039091208652850195909552929092016000205415159250611d2d9150505760009150611d7c565b611d3683611b28565b9050600080805483908110611d4757fe5b600091825260209091206004600590920201015460ff166002811115611d6957fe5b14611d775760019150611d7c565b600091505b50919050565b6000611d8d82611b28565b600081815260046020908152604080832033845290915290205490915060ff1615156103605760008181526004602090815260408083203384528252808320805460ff19166001908117909155938352600590915290208054909101905550565b600080600080611ea3600086815481101515611e0657fe5b6000918252602091829020600590910201805460408051601f6002600019610100600187161502019094169390930492830185900485028101850190915281815292830182828015611e995780601f10611e6e57610100808354040283529160200191611e99565b820191906000526020600020905b815481529060010190602001808311611e7c57829003601f168201915b50505050506130bf565b15612961576000805486908110611eb657fe5b60009182526020909120600360059092020101935060016000805487908110611edb57fe5b600091825260209091206004600590920201015460ff166002811115611efd57fe5b14156122de576000805486908110611f1157fe5b9060005260206000209060050201600201600086815481101515611f3157fe5b600091825260208083208454600180820180885596865292909420600593909302016003018054611f7d9493909301929091600260001991831615610100029190910190911604613eef565b5050612193600086815481101515611f9157fe5b6000918252602091829020600590910201805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156120245780601f10611ff957610100808354040283529160200191612024565b820191906000526020600020905b81548152906001019060200180831161200757829003601f168201915b505050505060008781548110151561203857fe5b90600052602060002090600502016001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120dd5780601f106120b2576101008083540402835291602001916120dd565b820191906000526020600020905b8154815290600101906020018083116120c057829003601f168201915b50505050506000888154811015156120f157fe5b6000918252602091829020600360059092020101805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156121875780601f1061215c57610100808354040283529160200191612187565b820191906000526020600020905b81548152906001019060200180831161216a57829003601f168201915b5050505050600161311c565b7f6f4d370520782587dabc737a258f46de81ad45d733a42cd5a0045cff1e46deb46000868154811015156121c357fe5b60009182526020918290206040805181815260059093029091018054600260001961010060018416150201909116049183018290529288929182918201906060830190869080156122555780601f1061222a57610100808354040283529160200191612255565b820191906000526020600020905b81548152906001019060200180831161223857829003601f168201915b50508381038252845460026000196101006001841615020190911604808252602090910190859080156122c95780601f1061229e576101008083540402835291602001916122c9565b820191906000526020600020905b8154815290600101906020018083116122ac57829003601f168201915b505094505050505060405180910390a16128e5565b60009250600091506124206000868154811015156122f857fe5b6000918252602091829020600590910201805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561238b5780601f106123605761010080835404028352916020019161238b565b820191906000526020600020905b81548152906001019060200180831161236e57829003601f168201915b5050885460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815294508a935091508301828280156124165780601f106123eb57610100808354040283529160200191612416565b820191906000526020600020905b8154815290600101906020018083116123f957829003601f168201915b5050505050612ca8565b90935091508190505b600160008681548110151561243a57fe5b906000526020600020906005020160020180549050038110156124ef57600080548690811061246557fe5b90600052602060002090600502016002018160010181548110151561248657fe5b9060005260206000200160008681548110151561249f57fe5b9060005260206000209060050201600201828154811015156124bd57fe5b9060005260206000200190805460018160011615610100020316600290046124e6929190613eef565b50600101612429565b60008054869081106124fd57fe5b9060005260206000209060050201600201600160008781548110151561251f57fe5b9060005260206000209060050201600201805490500381548110151561254157fe5b9060005260206000200160006125579190613f64565b600080548690811061256557fe5b90600052602060002090600502016002018054809190600190036125899190613fab565b5061279e60008681548110151561259c57fe5b6000918252602091829020600590910201805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561262f5780601f106126045761010080835404028352916020019161262f565b820191906000526020600020905b81548152906001019060200180831161261257829003601f168201915b505050505060008781548110151561264357fe5b90600052602060002090600502016001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156126e85780601f106126bd576101008083540402835291602001916126e8565b820191906000526020600020905b8154815290600101906020018083116126cb57829003601f168201915b50505050506000888154811015156126fc57fe5b6000918252602091829020600360059092020101805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156127925780601f1061276757610100808354040283529160200191612792565b820191906000526020600020905b81548152906001019060200180831161277557829003601f168201915b5050505050600261311c565b7f2e0a2dc845dce9ef7206b8fe38f3dacaad17ba74d7be9fba469c9858ae16a5d66000868154811015156127ce57fe5b60009182526020918290206040805181815260059093029091018054600260001961010060018416150201909116049183018290529288929182918201906060830190869080156128605780601f1061283557610100808354040283529160200191612860565b820191906000526020600020905b81548152906001019060200180831161284357829003601f168201915b50508381038252845460026000196101006001841615020190911604808252602090910190859080156128d45780601f106128a9576101008083540402835291602001916128d4565b820191906000526020600020905b8154815290600101906020018083116128b757829003601f168201915b505094505050505060405180910390a15b600080868154811015156128f557fe5b60009182526020909120600460059092020101805460ff1916600183600281111561291c57fe5b02179055506040805160208101909152600080825280548790811061293d57fe5b906000526020600020906005020160030190805190602001906115e3929190613d13565b5050505050565b600080600061297684611b28565b915060036000808481548110151561298a57fe5b906000526020600020906005020160010160405160200180828054600181600116156101000203166002900480156129f95780601f106129d75761010080835404028352918201916129f9565b820191906000526020600020905b8154815290600101906020018083116129e5575b50509150506040516020818303038152906040526040518082805190602001908083835b60208310612a3c5780518252601f199092019160209182019101612a1d565b51815160209384036101000a600019018019909216911617905260408051929094018290039091208652850195909552929092016000205415159250612b21915050577faca1d1ef8876e1135c8c76871025becb2eefcbdb13c62fcd55c51dc174abf7af846040518080602001828103825283818151815260200191508051906020019080838360005b83811015612ade578181015183820152602001612ac6565b50505050905090810190601f168015612b0b5780820380516001836020036101000a031916815260200191505b509250505060405180910390a160009250612bc1565b612b336000838154811015156103bd57fe5b9050600281815481101515612b4457fe5b60009182526020909120600160039092020101541515612bbc577faca1d1ef8876e1135c8c76871025becb2eefcbdb13c62fcd55c51dc174abf7af8460405180806020018281038252838181518152602001915080519060200190808383600083811015612ade578181015183820152602001612ac6565b600192505b5050919050565b6000806000612bd684611b28565b9250612bea6000848154811015156103bd57fe5b9150600090505b6002805483908110612bff57fe5b906000526020600020906003020160010180549050811015612c945760008381526004602052604081206002805483919086908110612c3a57fe5b906000526020600020906003020160010184815481101515612c5857fe5b600091825260208083209190910154600160a060020a031683528201929092526040019020805460ff1916911515919091179055600101612bf1565b505060009081526005602052604081205550565b600080808080612cb787611b28565b9150600090505b6000805483908110612ccc57fe5b906000526020600020906005020160020180549050811015612ecc57856040516020018082805190602001908083835b60208310612d1b5780518252601f199092019160209182019101612cfc565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310612d7e5780518252601f199092019160209182019101612d5f565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091206000805491945092508591508110612dbb57fe5b906000526020600020906005020160020182815481101515612dd957fe5b906000526020600020016040516020018082805460018160011615610100020316600290048015612e415780601f10612e1f576101008083540402835291820191612e41565b820191906000526020600020905b815481529060010190602001808311612e2d575b50509150506040516020818303038152906040526040518082805190602001908083835b60208310612e845780518252601f199092019160209182019101612e65565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600019161415612ec45760019250612ecc565b600101612cbe565b9196919550909350505050565b60008080808080612ee988611b28565b9250612efd6000848154811015156103bd57fe5b9150600090505b6002805483908110612f1257fe5b9060005260206000209060030201600101805490508110156130b157866040516020018082600160a060020a0316600160a060020a03166c010000000000000000000000000281526014019150506040516020818303038152906040526040518082805190602001908083835b60208310612f9e5780518252601f199092019160209182019101612f7f565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091206002805491945092508591508110612fdb57fe5b906000526020600020906003020160010182815481101515612ff957fe5b6000918252602091829020015460408051600160a060020a039092166c0100000000000000000000000002828401528051601481840301815260349092019081905281519192909182918401908083835b602083106130695780518252601f19909201916020918201910161304a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191614156130a957600193506130b1565b600101612f04565b929792965091945050505050565b6000806130cb83611b28565b9050600280828154811015156130dd57fe5b9060005260206000209060030201600101805490508115156130fb57fe5b6000838152600560205260409020549190041015611d775760019150611d7c565b600080600080600061312d88611c0a565b9450600186600281111561313d57fe5b14156133b45760009350600092505b600280548690811061315a57fe5b90600052602060002090600302016002018054905083101561335d57866040516020018082805190602001908083835b602083106131a95780518252601f19909201916020918201910161318a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b6020831061320c5780518252601f1990920191602091820191016131ed565b5181516020939093036101000a60001901801990911692169190911790526040519201829003909120600080549194509250889150811061324957fe5b90600052602060002090600502016002018481548110151561326757fe5b9060005260206000200160405160200180828054600181600116156101000203166002900480156132cf5780601f106132ad5761010080835404028352918201916132cf565b820191906000526020600020905b8154815290600101906020018083116132bb575b50509150506040516020818303038152906040526040518082805190602001908083835b602083106133125780518252601f1990920191602091820191016132f3565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600019161415613352576001935061335d565b60019092019161314c565b8315156133af57600280548690811061337257fe5b60009182526020808320600260039093020191909101805460018101808355918452928290208a5191936133ac93910191908b0190613d13565b50505b610d3b565b6133bf898989613746565b1515610d3b57600091505b60028054869081106133d857fe5b9060005260206000209060030201600201805490508310156135d757866040516020018082805190602001908083835b602083106134275780518252601f199092019160209182019101613408565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b6020831061348a5780518252601f19909201916020918201910161346b565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912060028054919450925088915081106134c757fe5b9060005260206000209060030201600201838154811015156134e557fe5b90600052602060002001604051602001808280546001816001161561010002031660029004801561354d5780601f1061352b57610100808354040283529182019161354d565b820191906000526020600020905b815481529060010190602001808311613539575b50509150506040516020818303038152906040526040518082805190602001908083835b602083106135905780518252601f199092019160209182019101613571565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191614156135cc576135d7565b6001909101906133ca565b50805b60016002868154811015156135eb57fe5b906000526020600020906003020160020180549050038110156136a057600280548690811061361657fe5b90600052602060002090600302016002018160010181548110151561363757fe5b9060005260206000200160028681548110151561365057fe5b90600052602060002090600302016002018281548110151561366e57fe5b906000526020600020019080546001816001161561010002031660029004613697929190613eef565b506001016135da565b60028054869081106136ae57fe5b906000526020600020906003020160020160016002878154811015156136d057fe5b906000526020600020906003020160020180549050038154811015156136f257fe5b9060005260206000200160006137089190613f64565b600280548690811061371657fe5b906000526020600020906003020160020180548091906001900361373a9190613fab565b50505050505050505050565b60008080805b600054821015613d0457866040516020018082805190602001908083835b602083106137895780518252601f19909201916020918201910161376a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083106137ec5780518252601f1990920191602091820191016137cd565b5181516020939093036101000a60001901801990911692169190911790526040519201829003909120600080549194509250859150811061382957fe5b906000526020600020906005020160000160405160200180828054600181600116156101000203166002900480156138985780601f10613876576101008083540402835291820191613898565b820191906000526020600020905b815481529060010190602001808311613884575b50509150506040516020818303038152906040526040518082805190602001908083835b602083106138db5780518252601f1990920191602091820191016138bc565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141561391757613cf9565b856040516020018082805190602001908083835b6020831061394a5780518252601f19909201916020918201910161392b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083106139ad5780518252601f19909201916020918201910161398e565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912060008054919450925085915081106139ea57fe5b90600052602060002090600502016001016040516020018082805460018160011615610100020316600290048015613a595780601f10613a37576101008083540402835291820191613a59565b820191906000526020600020905b815481529060010190602001808311613a45575b50509150506040516020818303038152906040526040518082805190602001908083835b60208310613a9c5780518252601f199092019160209182019101613a7d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600019161415613ce5575060005b6000805483908110613ae557fe5b906000526020600020906005020160020180549050811015613ce557846040516020018082805190602001908083835b60208310613b345780518252601f199092019160209182019101613b15565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310613b975780518252601f199092019160209182019101613b78565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091206000805491945092508591508110613bd457fe5b906000526020600020906005020160020182815481101515613bf257fe5b906000526020600020016040516020018082805460018160011615610100020316600290048015613c5a5780601f10613c38576101008083540402835291820191613c5a565b820191906000526020600020905b815481529060010190602001808311613c46575b50509150506040516020818303038152906040526040518082805190602001908083835b60208310613c9d5780518252601f199092019160209182019101613c7e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600019161415613cdd5760019250613ce5565b600101613ad7565b60018315151415613cf95760019350613d09565b60019091019061374c565b600093505b5050509392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613d5457805160ff1916838001178555613d81565b82800160010185558215613d81579182015b82811115613d81578251825591602001919060010190613d66565b50613d8d929150613fcf565b5090565b828054828255906000526020600020908101928215613dde579160200282015b82811115613dde5782518051613dce918491602090910190613d13565b5091602001919060010190613db1565b50613d8d929150613fec565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613e2b5782800160ff19823516178555613d81565b82800160010185558215613d81579182015b82811115613d81578235825591602001919060010190613e3d565b828054828255906000526020600020908101928215613eba579160200282015b82811115613eba578251825473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909116178255602090920191600190910190613e78565b50613d8d92915061400f565b815481835581811115613eea57600083815260209020613eea918101908301613fcf565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613f285780548555613d81565b82800160010185558215613d8157600052602060002091601f016020900482015b82811115613d81578254825591600101919060010190613f49565b50805460018160011615610100020316600290046000825580601f10613f8a5750613fa8565b601f016020900490600052602060002090810190613fa89190613fcf565b50565b815481835581811115613eea57600083815260209020613eea918101908301613fec565b613fe991905b80821115613d8d5760008155600101613fd5565b90565b613fe991905b80821115613d8d5760006140068282613f64565b50600101613ff2565b613fe991905b80821115613d8d57805473ffffffffffffffffffffffffffffffffffffffff191681556001016140155600a165627a7a72305820561aa676285a47bee0b60a17eb33b545fd2bca718f4e472f71f69f9dc3029c770029 \ No newline at end of file +60806040526004361061008e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631f9534801461009357806335dc4772146100e657806349379c50146101215780635607395b1461017457806359cbd6fe146101cf578063c7304f3f1461022a578063d88ce6bb14610265578063d912967a146102b8575b600080fd5b34801561009f57600080fd5b506100e460048036038101908080359060200190820180359060200191909192939192939080359060200190820180359060200191909192939192939050505061030b565b005b3480156100f257600080fd5b5061011f6004803603810190808035906020019082018035906020019190919293919293905050506107f2565b005b34801561012d57600080fd5b50610172600480360381019080803590602001908201803590602001919091929391929390803590602001908201803590602001919091929391929390505050610b67565b005b34801561018057600080fd5b506101cd600480360381019080803590602001908201803590602001919091929391929390803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e11565b005b3480156101db57600080fd5b50610228600480360381019080803590602001908201803590602001919091929391929390803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611143565b005b34801561023657600080fd5b506102636004803603810190808035906020019082018035906020019190919293919293905050506115ad565b005b34801561027157600080fd5b506102b66004803603810190808035906020019082018035906020019190919293919293908035906020019082018035906020019190919293919293905050506118fb565b005b3480156102c457600080fd5b506102f1600480360381019080803590602001908201803590602001919091929391929390505050611bc0565b604051808215151515815260200191505060405180910390f35b6000600360008484604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310151561036d5780518252602082019150602081019050602083039250610348565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660001916815260200190815260200160002054141561040d577fa4f69f0a4296104a861bac36ea23551d6d71a4b2d9f788ea28468eef956b4e578282604051808060200182810382528484828181526020019250808284378201915050935050505060405180910390a16107ec565b6000600160008686604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310151561046f578051825260208201915060208101905060208303925061044a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660001916815260200190815260200160002054141561079957600660008154809291906001019190505550600654600160008686604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310151561052e5780518252602082019150602081019050602083039250610509565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660001916815260200190815260200160002081905550600060a06040519081016040528086868080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050815260200184848080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508152602001600060405190808252806020026020018201604052801561062857816020015b60608152602001906001900390816106135790505b50815260200160006040519080825280601f01601f1916602001820160405280156106625781602001602082028038833980820191505090505b5081526020016000600281111561067557fe5b8152509080600181540180825580915050906001820390600052602060002090600502016000909192909190915060008201518160000190805190602001906106bf92919061459e565b5060208201518160010190805190602001906106dc92919061459e565b5060408201518160020190805190602001906106f992919061461e565b50606082015181600301908051906020019061071692919061459e565b5060808201518160040160006101000a81548160ff0219169083600281111561073b57fe5b02179055505050507fd734c07873f32f0735016e51dc718e21a48a3bec999d5be38cf3af363fbfedab8282604051808060200182810382528484828181526020019250808284378201915050935050505060405180910390a16107eb565b7f2b24431229489a8557abb42bd24fcf95defc95e5c1277f2b08c4860e7f62ee358282604051808060200182810382528484828181526020019250808284378201915050935050505060405180910390a15b5b50505050565b600082828080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050506000806000806000935061083a85611c81565b92506108fd60008481548110151561084e57fe5b90600052602060002090600502016001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108f35780601f106108c8576101008083540402835291602001916108f3565b820191906000526020600020905b8154815290600101906020018083116108d657829003601f168201915b5050505050611d76565b9150600090505b60028281548110151561091357fe5b9060005260206000209060030201600101805490508110156109d0573373ffffffffffffffffffffffffffffffffffffffff1660028381548110151561095557fe5b90600052602060002090600302016001018281548110151561097357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156109c357600193506109d0565b8080600101915050610904565b831515610a45576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4163636f756e742063616e6e6f7420766f74650000000000000000000000000081525060200191505060405180910390fd5b610a8088888080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050611e6c565b15610b0b57610ac088888080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050611c81565b9550610afd88888080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050611fd6565b610b06866120de565b610b5d565b7fe820171ad1d64f6ca44bb0943acbac4c6085812bf91e8b7916462956398062288888604051808060200182810382528484828181526020019250808284378201915050935050505060405180910390a15b5050505050505050565b600080600080610ba888888080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050612d3a565b93508315610e0757610beb88888080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050611c81565b92506000915060009050610c6388888080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505087878080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050613047565b8093508192505050600115158115151415610db4578585600085815481101515610c8957fe5b90600052602060002090600502016003019190610ca792919061467e565b506002600084815481101515610cb957fe5b906000526020600020906005020160040160006101000a81548160ff02191690836002811115610ce557fe5b0217905550610d2588888080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505061329b565b7f4475befcee492797e02530076fd7e138aa058eb3bcd028a9df5c0f2815ba9f4a8888600289896040518080602001856002811115610d6057fe5b60ff16815260200180602001838103835288888281815260200192508082843782019150508381038252858582818152602001925080828437820191505097505050505050505060405180910390a1610e06565b7f1625cf45f71f82c8ccf66926c15856f85b1e08dbe285065512100db776fdeb288686604051808060200182810382528484828181526020019250808284378201915050935050505060405180910390a15b5b5050505050505050565b600080600080600360008888604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b602083101515610e775780518252602082019150602081019050602083039250610e52565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916600019168152602001908152602001600020541415610f17577fa4f69f0a4296104a861bac36ea23551d6d71a4b2d9f788ea28468eef956b4e578686604051808060200182810382528484828181526020019250808284378201915050935050505060405180910390a161113b565b6000925060009150610f5b86868080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508561348a565b80935081945050508215610ff3577f57c0436fcca42a02516ed36a118ab7196a853b19ae03db4cbe9d1f6ec5a8f30b86868660405180806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281038252858582818152602001925080828437820191505094505050505060405180910390a161113a565b61102e86868080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050611d76565b905060028181548110151561103f57fe5b90600052602060002090600302016001018490806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550507f424f3ad05c61ea35cad66f22b70b1fad7250d8229921238078c401db36d3457486868660405180806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281038252858582818152602001925080828437820191505094505050505060405180910390a15b5b505050505050565b6000806000806000600360008989604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b6020831015156111ab5780518252602082019150602081019050602083039250611186565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916600019168152602001908152602001600020541415611247577fa4f69f0a4296104a861bac36ea23551d6d71a4b2d9f788ea28468eef956b4e578787604051808060200182810382528484828181526020019250808284378201915050935050505060405180910390a15b61128287878080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050611d76565b93506112c087878080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508661348a565b9250925060011515831515141561151e578190505b60016002858154811015156112e657fe5b906000526020600020906003020160010180549050038110156113e05760028481548110151561131257fe5b90600052602060002090600302016001016001820181548110151561133357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660028581548110151561136d57fe5b90600052602060002090600302016001018281548110151561138b57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080806001019150506112d5565b6002848154811015156113ef57fe5b9060005260206000209060030201600101600160028681548110151561141157fe5b9060005260206000209060030201600101805490500381548110151561143357fe5b9060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560028481548110151561146f57fe5b906000526020600020906003020160010180548091906001900361149391906146fe565b507f654cd85d9b2abaf3affef0a047625d088e6e4d0448935c9b5016b5f5aa0ca3b687878760405180806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281038252858582818152602001925080828437820191505094505050505060405180910390a16115a4565b7ffc25f65937d1cb43a570fb3b3c5d0bf0b69b4cdd2da44c56b9893e2d1403596087878760405180806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281038252858582818152602001925080828437820191505094505050505060405180910390a15b50505050505050565b6000600360008484604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310151561160f57805182526020820191506020810190506020830392506115ea565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600019166000191681526020019081526020016000205414156118a557600760008154809291906001019190505550600754600360008484604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b6020831015156116ce57805182526020820191506020810190506020830392506116a9565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660001916815260200190815260200160002081905550600260606040519081016040528084848080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508152602001600060405190808252806020026020018201604052801561178b5781602001602082028038833980820191505090505b50815260200160006040519080825280602002602001820160405280156117c657816020015b60608152602001906001900390816117b15790505b5081525090806001815401808255809150509060018203906000526020600020906003020160009091929091909150600082015181600001908051906020019061181192919061459e565b50602082015181600101908051906020019061182e92919061472a565b50604082015181600201908051906020019061184b92919061461e565b505050507ffe62f8d1508aa8ddbb57fd8a6d631f4418cfcbafa90c6ce6d4b8105da56097298282604051808060200182810382528484828181526020019250808284378201915050935050505060405180910390a16118f7565b7f5c3bfabea6adb09ab9fcc026934927d15573bb92c42edcf1a4052b2342089f5e8282604051808060200182810382528484828181526020019250808284378201915050935050505060405180910390a15b5050565b60008060008061193c88888080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050612d3a565b93508315611bb65760009250600091506119ba88888080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505087878080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050613047565b80935081945050508215611a40577ffd2bb3c1cfc78c051cb1f0ed88147fb9348eba128a594dc66fbf35dc63fe692d888888886040518080602001806020018381038352878782818152602001925080828437820191505083810382528585828181526020019250808284378201915050965050505050505060405180910390a1611bb5565b611a7b88888080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050611c81565b90508585600083815481101515611a8e57fe5b90600052602060002090600502016003019190611aac92919061467e565b506001600082815481101515611abe57fe5b906000526020600020906005020160040160006101000a81548160ff02191690836002811115611aea57fe5b0217905550611b2a88888080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505061329b565b7f4475befcee492797e02530076fd7e138aa058eb3bcd028a9df5c0f2815ba9f4a8888600189896040518080602001856002811115611b6557fe5b60ff16815260200180602001838103835288888281815260200192508082843782019150508381038252858582818152602001925080828437820191505097505050505050505060405180910390a15b5b5050505050505050565b600080600360008585604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b602083101515611c235780518252602082019150602081019050602083039250611bfe565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916600019168152602001908152602001600020541415611c765760009050611c7b565b600190505b92915050565b60006001806000846040516020018082805190602001908083835b602083101515611cc15780518252602082019150602081019050602083039250611c9c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083101515611d2a5780518252602082019150602081019050602083039250611d05565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660001916815260200190815260200160002054039050919050565b6000600160036000846040516020018082805190602001908083835b602083101515611db75780518252602082019150602081019050602083039250611d92565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083101515611e205780518252602082019150602081019050602083039250611dfb565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660001916815260200190815260200160002054039050919050565b600080600060016000856040516020018082805190602001908083835b602083101515611eae5780518252602082019150602081019050602083039250611e89565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083101515611f175780518252602082019150602081019050602083039250611ef2565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916600019168152602001908152602001600020541415611f6a5760009150611fd0565b611f7383611c81565b905060006002811115611f8257fe5b600082815481101515611f9157fe5b906000526020600020906005020160040160009054906101000a900460ff166002811115611fbb57fe5b141515611fcb5760019150611fd0565b600091505b50919050565b6000611fe182611c81565b9050600015156004600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156120da5760016004600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060056000828152602001908152602001600020600081548092919060010191905055505b5050565b6000806000806121a56000868154811015156120f657fe5b90600052602060002090600502016000018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561219b5780601f106121705761010080835404028352916020019161219b565b820191906000526020600020905b81548152906001019060200180831161217e57829003601f168201915b50505050506136d5565b15612d33576000858154811015156121b957fe5b90600052602060002090600502016003019350600160028111156121d957fe5b6000868154811015156121e857fe5b906000526020600020906005020160040160009054906101000a900460ff16600281111561221257fe5b141561263c5760008581548110151561222757fe5b906000526020600020906005020160020160008681548110151561224757fe5b9060005260206000209060050201600301908060018154018082558091505090600182039060005260206000200160009091929091909150908054600181600116156101000203166002900461229e9291906147b4565b50506124d56000868154811015156122b257fe5b90600052602060002090600502016000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123575780601f1061232c57610100808354040283529160200191612357565b820191906000526020600020905b81548152906001019060200180831161233a57829003601f168201915b505050505060008781548110151561236b57fe5b90600052602060002090600502016001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124105780601f106123e557610100808354040283529160200191612410565b820191906000526020600020905b8154815290600101906020018083116123f357829003601f168201915b505050505060008881548110151561242457fe5b90600052602060002090600502016003018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124c95780601f1061249e576101008083540402835291602001916124c9565b820191906000526020600020905b8154815290600101906020018083116124ac57829003601f168201915b50505050506001613740565b7f6f4d370520782587dabc737a258f46de81ad45d733a42cd5a0045cff1e46deb460008681548110151561250557fe5b9060005260206000209060050201600001856040518080602001806020018381038352858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156125a45780601f10612579576101008083540402835291602001916125a4565b820191906000526020600020905b81548152906001019060200180831161258757829003601f168201915b50508381038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156126275780601f106125fc57610100808354040283529160200191612627565b820191906000526020600020905b81548152906001019060200180831161260a57829003601f168201915b505094505050505060405180910390a1612cac565b600092506000915061279f60008681548110151561265657fe5b90600052602060002090600502016000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156126fb5780601f106126d0576101008083540402835291602001916126fb565b820191906000526020600020905b8154815290600101906020018083116126de57829003601f168201915b5050505050858054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156127955780601f1061276a57610100808354040283529160200191612795565b820191906000526020600020905b81548152906001019060200180831161277857829003601f168201915b5050505050613047565b80935081945050508190505b60016000868154811015156127bc57fe5b90600052602060002090600502016002018054905003811015612877576000858154811015156127e857fe5b90600052602060002090600502016002016001820181548110151561280957fe5b9060005260206000200160008681548110151561282257fe5b90600052602060002090600502016002018281548110151561284057fe5b9060005260206000200190805460018160011615610100020316600290046128699291906147b4565b5080806001019150506127ab565b60008581548110151561288657fe5b906000526020600020906005020160020160016000878154811015156128a857fe5b906000526020600020906005020160020180549050038154811015156128ca57fe5b9060005260206000200160006128e0919061483b565b6000858154811015156128ef57fe5b90600052602060002090600502016002018054809190600190036129139190614883565b50612b4960008681548110151561292657fe5b90600052602060002090600502016000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156129cb5780601f106129a0576101008083540402835291602001916129cb565b820191906000526020600020905b8154815290600101906020018083116129ae57829003601f168201915b50505050506000878154811015156129df57fe5b90600052602060002090600502016001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612a845780601f10612a5957610100808354040283529160200191612a84565b820191906000526020600020905b815481529060010190602001808311612a6757829003601f168201915b5050505050600088815481101515612a9857fe5b90600052602060002090600502016003018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612b3d5780601f10612b1257610100808354040283529160200191612b3d565b820191906000526020600020905b815481529060010190602001808311612b2057829003601f168201915b50505050506002613740565b7f2e0a2dc845dce9ef7206b8fe38f3dacaad17ba74d7be9fba469c9858ae16a5d6600086815481101515612b7957fe5b906000526020600020906005020160000185604051808060200180602001838103835285818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015612c185780601f10612bed57610100808354040283529160200191612c18565b820191906000526020600020905b815481529060010190602001808311612bfb57829003601f168201915b5050838103825284818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015612c9b5780601f10612c7057610100808354040283529160200191612c9b565b820191906000526020600020905b815481529060010190602001808311612c7e57829003601f168201915b505094505050505060405180910390a15b60008086815481101515612cbc57fe5b906000526020600020906005020160040160006101000a81548160ff02191690836002811115612ce857fe5b02179055506020604051908101604052806000815250600086815481101515612d0d57fe5b90600052602060002090600502016003019080519060200190612d319291906148af565b505b5050505050565b60008060016000846040516020018082805190602001908083835b602083101515612d7a5780518252602082019150602081019050602083039250612d55565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083101515612de35780518252602082019150602081019050602083039250612dbe565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916600019168152602001908152602001600020541415612ed2577f0d426160118ead0b6900081fd1f08b0d9b626bd033ddd50cd7d24be253e11a83826040518080602001828103825283818151815260200191508051906020019080838360005b83811015612e8f578082015181840152602081019050612e74565b50505050905090810190601f168015612ebc5780820380516001836020036101000a031916815260200191505b509250505060405180910390a160009050613042565b612edb82613dc9565b15612f9857612ee982611e6c565b15612f93577f2de31d28953221328a1c7e30a93fa15e0d8573128a8f6fa92cf66408a0403c99826040518080602001828103825283818151815260200191508051906020019080838360005b83811015612f50578082015181840152602081019050612f35565b50505050905090810190601f168015612f7d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a160009050613042565b61303d565b7faca1d1ef8876e1135c8c76871025becb2eefcbdb13c62fcd55c51dc174abf7af826040518080602001828103825283818151815260200191508051906020019080838360005b83811015612ffa578082015181840152602081019050612fdf565b50505050905090810190601f1680156130275780820380516001836020036101000a031916815260200191505b509250505060405180910390a160009050613042565b600190505b919050565b600080600080600080925061305b87611c81565b9150600090505b60008281548110151561307157fe5b90600052602060002090600502016002018054905081101561328b57856040516020018082805190602001908083835b6020831015156130c657805182526020820191506020810190506020830392506130a1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310151561312f578051825260208201915060208101905060208303925061310a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660008381548110151561316f57fe5b90600052602060002090600502016002018281548110151561318d57fe5b9060005260206000200160405160200180828054600181600116156101000203166002900480156131f55780601f106131d35761010080835404028352918201916131f5565b820191906000526020600020905b8154815290600101906020018083116131e1575b50509150506040516020818303038152906040526040518082805190602001908083835b60208310151561323e5780518252602082019150602081019050602083039250613219565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141561327e576001925061328b565b8080600101915050613062565b8281945094505050509250929050565b60008060006132a984611c81565b925061336c6000848154811015156132bd57fe5b90600052602060002090600502016001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133625780601f1061333757610100808354040283529160200191613362565b820191906000526020600020905b81548152906001019060200180831161334557829003601f168201915b5050505050611d76565b9150600090505b60028281548110151561338257fe5b90600052602060002090600302016001018054905081101561346b5760006004600085815260200190815260200160002060006002858154811015156133c457fe5b9060005260206000209060030201600101848154811015156133e257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050613373565b6000600560008581526020019081526020016000208190555050505050565b600080600080600080925061349e87611d76565b9150600090505b6002828154811015156134b457fe5b9060005260206000209060030201600101805490508110156136c55785604051602001808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019150506040516020818303038152906040526040518082805190602001908083835b602083101515613560578051825260208201915060208101905060208303925061353b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600019166002838154811015156135a057fe5b9060005260206000209060030201600101828154811015156135be57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051602001808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019150506040516020818303038152906040526040518082805190602001908083835b6020831015156136785780518252602082019150602081019050602083039250613653565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191614156136b857600192506136c5565b80806001019150506134a5565b8281945094505050509250929050565b6000806136e183611c81565b9050600280828154811015156136f357fe5b90600052602060002090600302016001018054905081151561371157fe5b0460056000838152602001908152602001600020541115613735576001915061373a565b600091505b50919050565b600080600080600061375188611d76565b94506001600281111561376057fe5b86600281111561376c57fe5b1415613a145760009350600092505b60028581548110151561378a57fe5b9060005260206000209060030201600201805490508310156139a457866040516020018082805190602001908083835b6020831015156137df57805182526020820191506020810190506020830392506137ba565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b6020831015156138485780518252602082019150602081019050602083039250613823565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660028681548110151561388857fe5b9060005260206000209060030201600201848154811015156138a657fe5b90600052602060002001604051602001808280546001816001161561010002031660029004801561390e5780601f106138ec57610100808354040283529182019161390e565b820191906000526020600020905b8154815290600101906020018083116138fa575b50509150506040516020818303038152906040526040518082805190602001908083835b6020831015156139575780518252602082019150602081019050602083039250613932565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141561399757600193506139a4565b828060010193505061377b565b600015158415151415613a0f576002858154811015156139c057fe5b9060005260206000209060030201600201879080600181540180825580915050906001820390600052602060002001600090919290919091509080519060200190613a0c9291906148af565b50505b613dbe565b613a1f898989613f79565b1515613dbd57600091505b600285815481101515613a3957fe5b906000526020600020906003020160020180549050831015613c4f57866040516020018082805190602001908083835b602083101515613a8e5780518252602082019150602081019050602083039250613a69565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083101515613af75780518252602082019150602081019050602083039250613ad2565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916600286815481101515613b3757fe5b906000526020600020906003020160020183815481101515613b5557fe5b906000526020600020016040516020018082805460018160011615610100020316600290048015613bbd5780601f10613b9b576101008083540402835291820191613bbd565b820191906000526020600020905b815481529060010190602001808311613ba9575b50509150506040516020818303038152906040526040518082805190602001908083835b602083101515613c065780518252602082019150602081019050602083039250613be1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600019161415613c4257613c4f565b8180600101925050613a2a565b8190505b6001600286815481101515613c6457fe5b90600052602060002090600302016002018054905003811015613d1f57600285815481101515613c9057fe5b906000526020600020906003020160020160018201815481101515613cb157fe5b90600052602060002001600286815481101515613cca57fe5b906000526020600020906003020160020182815481101515613ce857fe5b906000526020600020019080546001816001161561010002031660029004613d119291906147b4565b508080600101915050613c53565b600285815481101515613d2e57fe5b90600052602060002090600302016002016001600287815481101515613d5057fe5b90600052602060002090600302016002018054905003815481101515613d7257fe5b906000526020600020016000613d88919061483b565b600285815481101515613d9757fe5b9060005260206000209060030201600201805480919060019003613dbb9190614883565b505b5b505050505050505050565b6000806000613dd784611c81565b9150613e9a600083815481101515613deb57fe5b90600052602060002090600502016001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613e905780601f10613e6557610100808354040283529160200191613e90565b820191906000526020600020905b815481529060010190602001808311613e7357829003601f168201915b5050505050611d76565b90506000600282815481101515613ead57fe5b9060005260206000209060030201600101805490501415613f6d577faca1d1ef8876e1135c8c76871025becb2eefcbdb13c62fcd55c51dc174abf7af846040518080602001828103825283818151815260200191508051906020019080838360005b83811015613f2a578082015181840152602081019050613f0f565b50505050905090810190601f168015613f575780820380516001836020036101000a031916815260200191505b509250505060405180910390a160009250613f72565b600192505b5050919050565b60008060008060009250600091505b60008054905082101561458f57866040516020018082805190602001908083835b602083101515613fce5780518252602082019150602081019050602083039250613fa9565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b6020831015156140375780518252602082019150602081019050602083039250614012565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660008381548110151561407757fe5b906000526020600020906005020160000160405160200180828054600181600116156101000203166002900480156140e65780601f106140c45761010080835404028352918201916140e6565b820191906000526020600020905b8154815290600101906020018083116140d2575b50509150506040516020818303038152906040526040518082805190602001908083835b60208310151561412f578051825260208201915060208101905060208303925061410a565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141561416b57614582565b856040516020018082805190602001908083835b6020831015156141a4578051825260208201915060208101905060208303925061417f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310151561420d57805182526020820191506020810190506020830392506141e8565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660008381548110151561424d57fe5b906000526020600020906005020160010160405160200180828054600181600116156101000203166002900480156142bc5780601f1061429a5761010080835404028352918201916142bc565b820191906000526020600020905b8154815290600101906020018083116142a8575b50509150506040516020818303038152906040526040518082805190602001908083835b60208310151561430557805182526020820191506020810190506020830392506142e0565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141561456b57600090505b60008281548110151561435057fe5b90600052602060002090600502016002018054905081101561456a57846040516020018082805190602001908083835b6020831015156143a55780518252602082019150602081019050602083039250614380565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310151561440e57805182526020820191506020810190506020830392506143e9565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660008381548110151561444e57fe5b90600052602060002090600502016002018281548110151561446c57fe5b9060005260206000200160405160200180828054600181600116156101000203166002900480156144d45780601f106144b25761010080835404028352918201916144d4565b820191906000526020600020905b8154815290600101906020018083116144c0575b50509150506040516020818303038152906040526040518082805190602001908083835b60208310151561451d57805182526020820191506020810190506020830392506144f8565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141561455d576001925061456a565b8080600101915050614341565b5b6001151583151514156145815760019350614594565b5b8180600101925050613f88565b600093505b5050509392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106145df57805160ff191683800117855561460d565b8280016001018555821561460d579182015b8281111561460c5782518255916020019190600101906145f1565b5b50905061461a919061492f565b5090565b82805482825590600052602060002090810192821561466d579160200282015b8281111561466c57825182908051906020019061465c92919061459e565b509160200191906001019061463e565b5b50905061467a9190614954565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106146bf57803560ff19168380011785556146ed565b828001600101855582156146ed579182015b828111156146ec5782358255916020019190600101906146d1565b5b5090506146fa919061492f565b5090565b81548183558181111561472557818360005260206000209182019101614724919061492f565b5b505050565b8280548282559060005260206000209081019282156147a3579160200282015b828111156147a25782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019061474a565b5b5090506147b09190614980565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106147ed578054855561482a565b8280016001018555821561482a57600052602060002091601f016020900482015b8281111561482957825482559160010191906001019061480e565b5b509050614837919061492f565b5090565b50805460018160011615610100020316600290046000825580601f106148615750614880565b601f01602090049060005260206000209081019061487f919061492f565b5b50565b8154818355818111156148aa578183600052602060002091820191016148a99190614954565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106148f057805160ff191683800117855561491e565b8280016001018555821561491e579182015b8281111561491d578251825591602001919060010190614902565b5b50905061492b919061492f565b5090565b61495191905b8082111561494d576000816000905550600101614935565b5090565b90565b61497d91905b808211156149795760008181614970919061483b565b5060010161495a565b5090565b90565b6149c091905b808211156149bc57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101614986565b5090565b905600a165627a7a72305820558afb7bb0803125bed77bb75eb2d40f1c1609b89d0f138093fbacd1a3765ac60029 \ No newline at end of file diff --git a/controls/cluster/cluster.go b/controls/cluster/cluster.go index 64e75fd3b..8eb1bacef 100644 --- a/controls/cluster/cluster.go +++ b/controls/cluster/cluster.go @@ -63,7 +63,7 @@ func (k *OrgKeyCtrl) populatePrivateKeys() error { for recExists { recExists = pastAddEvents.Next() if recExists { - types.AddOrgKey(pastAddEvents.Event.OrgId, pastAddEvents.Event.PrivateKey) + types.AddOrgKey(pastAddEvents.Event.OrgId, pastAddEvents.Event.TmKey) } } @@ -74,7 +74,7 @@ func (k *OrgKeyCtrl) populatePrivateKeys() error { for recExists { recExists = pastDeleteEvents.Next() if recExists { - types.DeleteOrgKey(pastDeleteEvents.Event.OrgId, pastDeleteEvents.Event.PrivateKey) + types.DeleteOrgKey(pastDeleteEvents.Event.OrgId, pastDeleteEvents.Event.TmKey) } } return nil @@ -106,7 +106,7 @@ func (k *OrgKeyCtrl) monitorKeyAdd() { for { select { case newEvent = <-ch: - types.AddOrgKey(newEvent.OrgId, newEvent.PrivateKey) + types.AddOrgKey(newEvent.OrgId, newEvent.TmKey) } } } @@ -131,7 +131,7 @@ func (k *OrgKeyCtrl) monitorKeyDelete() { for { select { case newEvent = <-ch: - types.DeleteOrgKey(newEvent.OrgId, newEvent.PrivateKey) + types.DeleteOrgKey(newEvent.OrgId, newEvent.TmKey) } } } diff --git a/core/quorum/api.go b/core/quorum/api.go index e5df6afe8..05adf796c 100644 --- a/core/quorum/api.go +++ b/core/quorum/api.go @@ -47,12 +47,17 @@ const ( type OrgKeyAction int const ( - AddOrgKey OrgKeyAction = iota - RemoveOrgKey + AddMasterOrg OrgKeyAction = iota + AddSubOrg + AddOrgVoter + DeleteOrgVoter + AddOrgKey + DeleteOrgKey + ApprovePendingOp ) -// PermissionAPI provides an API to access Quorum's node permission and org key management related services -type PermissionAPI struct { +// QuorumControlsAPI provides an API to access Quorum's node permission and org key management related services +type QuorumControlsAPI struct { txPool *core.TxPool ethClnt *ethclient.Client acntMgr *accounts.Manager @@ -68,7 +73,8 @@ type txArgs struct { voter common.Address nodeId string orgId string - keyId string + morgId string + tmKey string txa ethapi.SendTxArgs acctId common.Address accessType string @@ -100,6 +106,7 @@ var ( ErrPermissionDisabled = ExecStatus{false, "Permissions control not enabled"} ErrAccountAccess = ExecStatus{false, "Account does not have sufficient access for operation"} ErrVoterAccountAccess = ExecStatus{false, "Voter account does not have sufficient access"} + ErrMasterOrgExists = ExecStatus{false, "Master org already exists"} ExecSuccess = ExecStatus{true, "Action completed successfully"} ) @@ -123,9 +130,9 @@ var ( } ) -// NewPermissionAPI creates a new PermissionAPI to access quorum services -func NewPermissionAPI(tp *core.TxPool, am *accounts.Manager) *PermissionAPI { - return &PermissionAPI{tp, nil, am, nil, nil, nil, nil, false} +// NewQuorumControlsAPI creates a new QuorumControlsAPI to access quorum services +func NewQuorumControlsAPI(tp *core.TxPool, am *accounts.Manager) *QuorumControlsAPI { + return &QuorumControlsAPI{tp, nil, am, nil, nil, nil, nil, false} } // helper function decodes the node status to string @@ -136,8 +143,8 @@ func decodeNodeStatus(nodeStatus uint8) string { return "Unknown" } -//Init initializes PermissionAPI with eth client, permission contract and org key management control -func (p *PermissionAPI) Init(ethClnt *ethclient.Client, key *ecdsa.PrivateKey) error { +//Init initializes QuorumControlsAPI with eth client, permission contract and org key management control +func (p *QuorumControlsAPI) Init(ethClnt *ethclient.Client, key *ecdsa.PrivateKey) error { p.ethClnt = ethClnt permContr, err := pbind.NewPermissions(params.QuorumPermissionsContract, p.ethClnt) if err != nil { @@ -155,7 +162,7 @@ func (p *PermissionAPI) Init(ethClnt *ethclient.Client, key *ecdsa.PrivateKey) e } // Returns the list of Nodes and status of each -func (s *PermissionAPI) PermissionNodeList() []nodeStatus { +func (s *QuorumControlsAPI) PermissionNodeList() []nodeStatus { if !s.enabled { nodeStatArr := make([]nodeStatus, 1) nodeStatArr[0].EnodeId = "Permisssions control not enabled for network" @@ -188,7 +195,7 @@ func (s *PermissionAPI) PermissionNodeList() []nodeStatus { return nodeStatArr } -func (s *PermissionAPI) PermissionAccountList() []accountInfo { +func (s *QuorumControlsAPI) PermissionAccountList() []accountInfo { if !s.enabled { acctInfoArr := make([]accountInfo, 1) acctInfoArr[0].Address = "Account access control not enable for the network" @@ -218,7 +225,7 @@ func (s *PermissionAPI) PermissionAccountList() []accountInfo { return acctInfoArr } -func (s *PermissionAPI) VoterList() []string { +func (s *QuorumControlsAPI) VoterList() []string { if !s.enabled { voterArr := make([]string, 1) voterArr[0] = "Permissions control not enabled for the network" @@ -247,7 +254,7 @@ func (s *PermissionAPI) VoterList() []string { return voterArr } -func (s *PermissionAPI) newPermSessionWithNodeKeySigner() *pbind.PermissionsSession { +func (s *QuorumControlsAPI) newPermSessionWithNodeKeySigner() *pbind.PermissionsSession { auth := bind.NewKeyedTransactor(s.key) ps := &pbind.PermissionsSession{ Contract: s.permContr, @@ -272,71 +279,90 @@ func decodeAccountPermission(access uint8) string { } // AddVoter adds an account to the list of accounts that can approve nodes proposed or deactivated -func (s *PermissionAPI) AddVoter(vaddr common.Address, txa ethapi.SendTxArgs) ExecStatus { +func (s *QuorumControlsAPI) AddVoter(vaddr common.Address, txa ethapi.SendTxArgs) ExecStatus { return s.executePermAction(AddVoter, txArgs{voter: vaddr, txa: txa}) } // RemoveVoter removes an account from the list of accounts that can approve nodes proposed or deactivated -func (s *PermissionAPI) RemoveVoter(vaddr common.Address, txa ethapi.SendTxArgs) ExecStatus { +func (s *QuorumControlsAPI) RemoveVoter(vaddr common.Address, txa ethapi.SendTxArgs) ExecStatus { return s.executePermAction(RemoveVoter, txArgs{voter: vaddr, txa: txa}) } // ProposeNode proposes a node to join the network -func (s *PermissionAPI) ProposeNode(nodeId string, txa ethapi.SendTxArgs) ExecStatus { +func (s *QuorumControlsAPI) ProposeNode(nodeId string, txa ethapi.SendTxArgs) ExecStatus { return s.executePermAction(ProposeNode, txArgs{nodeId: nodeId, txa: txa}) } // ApproveNode approves a proposed node to join the network -func (s *PermissionAPI) ApproveNode(nodeId string, txa ethapi.SendTxArgs) ExecStatus { +func (s *QuorumControlsAPI) ApproveNode(nodeId string, txa ethapi.SendTxArgs) ExecStatus { return s.executePermAction(ApproveNode, txArgs{nodeId: nodeId, txa: txa}) } // DeactivateNode requests a node to get deactivated -func (s *PermissionAPI) ProposeNodeDeactivation(nodeId string, txa ethapi.SendTxArgs) ExecStatus { +func (s *QuorumControlsAPI) ProposeNodeDeactivation(nodeId string, txa ethapi.SendTxArgs) ExecStatus { return s.executePermAction(ProposeNodeDeactivation, txArgs{nodeId: nodeId, txa: txa}) } // ApproveDeactivateNode approves a node to get deactivated -func (s *PermissionAPI) ApproveNodeDeactivation(nodeId string, txa ethapi.SendTxArgs) ExecStatus { +func (s *QuorumControlsAPI) ApproveNodeDeactivation(nodeId string, txa ethapi.SendTxArgs) ExecStatus { return s.executePermAction(ApproveNodeDeactivation, txArgs{nodeId: nodeId, txa: txa}) } // DeactivateNode requests a node to get deactivated -func (s *PermissionAPI) ProposeNodeActivation(nodeId string, txa ethapi.SendTxArgs) ExecStatus { +func (s *QuorumControlsAPI) ProposeNodeActivation(nodeId string, txa ethapi.SendTxArgs) ExecStatus { return s.executePermAction(ProposeNodeActivation, txArgs{nodeId: nodeId, txa: txa}) } // ApproveDeactivateNode approves a node to get deactivated -func (s *PermissionAPI) ApproveNodeActivation(nodeId string, txa ethapi.SendTxArgs) ExecStatus { +func (s *QuorumControlsAPI) ApproveNodeActivation(nodeId string, txa ethapi.SendTxArgs) ExecStatus { return s.executePermAction(ApproveNodeActivation, txArgs{nodeId: nodeId, txa: txa}) } // DeactivateNode requests a node to get deactivated -func (s *PermissionAPI) ProposeNodeBlacklisting(nodeId string, txa ethapi.SendTxArgs) ExecStatus { +func (s *QuorumControlsAPI) ProposeNodeBlacklisting(nodeId string, txa ethapi.SendTxArgs) ExecStatus { return s.executePermAction(ProposeNodeBlacklisting, txArgs{nodeId: nodeId, txa: txa}) } // ApproveDeactivateNode approves a node to get deactivated -func (s *PermissionAPI) ApproveNodeBlacklisting(nodeId string, txa ethapi.SendTxArgs) ExecStatus { +func (s *QuorumControlsAPI) ApproveNodeBlacklisting(nodeId string, txa ethapi.SendTxArgs) ExecStatus { return s.executePermAction(ApproveNodeBlacklisting, txArgs{nodeId: nodeId, txa: txa}) } +// AddMasterOrg adds an new master organization to the contract +func (s *QuorumControlsAPI) AddMasterOrg(morgId string, txa ethapi.SendTxArgs) ExecStatus { + return s.executeOrgKeyAction(AddMasterOrg, txArgs{txa: txa, morgId: morgId}) +} + // RemoveOrgKey removes an org key combination from the org key map -func (s *PermissionAPI) RemoveOrgKey(orgId string, pvtKey string, txa ethapi.SendTxArgs) ExecStatus { - return s.executeOrgKeyAction(RemoveOrgKey, txArgs{txa: txa, orgId: orgId, keyId: pvtKey}) +func (s *QuorumControlsAPI) AddSubOrg(orgId string, morgId string, txa ethapi.SendTxArgs) ExecStatus { + return s.executeOrgKeyAction(AddSubOrg, txArgs{txa: txa, orgId: orgId, morgId: morgId}) } - // AddOrgKey adds an org key combination to the org key map -func (s *PermissionAPI) AddOrgKey(orgId string, pvtKey string, txa ethapi.SendTxArgs) ExecStatus { - return s.executeOrgKeyAction(AddOrgKey, txArgs{txa: txa, orgId: orgId, keyId: pvtKey}) +func (s *QuorumControlsAPI) AddOrgVoter(morgId string, acctId common.Address, txa ethapi.SendTxArgs) ExecStatus { + return s.executeOrgKeyAction(AddOrgVoter, txArgs{txa: txa, morgId: morgId, acctId: acctId}) } -func (s *PermissionAPI) SetAccountAccess(acct common.Address, access string, txa ethapi.SendTxArgs) ExecStatus { +// RemoveOrgKey removes an org key combination from the org key map +func (s *QuorumControlsAPI) DeleteOrgVoter(morgId string, acctId common.Address, txa ethapi.SendTxArgs) ExecStatus { + return s.executeOrgKeyAction(DeleteOrgVoter, txArgs{txa: txa, morgId: morgId, acctId: acctId}) +} + +func (s *QuorumControlsAPI) AddOrgKey(orgId string, tmKey string, txa ethapi.SendTxArgs) ExecStatus { + return s.executeOrgKeyAction(AddOrgKey, txArgs{txa: txa, orgId: orgId, tmKey: tmKey}) +} + +// RemoveOrgKey removes an org key combination from the org key map +func (s *QuorumControlsAPI) DeleteOrgKey(orgId string, tmKey string, txa ethapi.SendTxArgs) ExecStatus { + return s.executeOrgKeyAction(DeleteOrgKey, txArgs{txa: txa, orgId: orgId, tmKey: tmKey}) +} + + +func (s *QuorumControlsAPI) SetAccountAccess(acct common.Address, access string, txa ethapi.SendTxArgs) ExecStatus { return s.executePermAction(SetAccountAccess, txArgs{acctId: acct, accessType: access, txa: txa}) } // executePermAction helps to execute an action in permission contract -func (s *PermissionAPI) executePermAction(action PermAction, args txArgs) ExecStatus { +func (s *QuorumControlsAPI) executePermAction(action PermAction, args txArgs) ExecStatus { if !s.enabled { return ErrPermissionDisabled @@ -503,7 +529,7 @@ func (s *PermissionAPI) executePermAction(action PermAction, args txArgs) ExecSt } // executeOrgKeyAction helps to execute an action in cluster contract -func (s *PermissionAPI) executeOrgKeyAction(action OrgKeyAction, args txArgs) ExecStatus { +func (s *QuorumControlsAPI) executeOrgKeyAction(action OrgKeyAction, args txArgs) ExecStatus { if !s.enabled { return ErrPermissionDisabled } @@ -515,21 +541,37 @@ func (s *PermissionAPI) executeOrgKeyAction(action OrgKeyAction, args txArgs) Ex var tx *types.Transaction switch action { + case AddMasterOrg: + // check if the master org exists. if yes throw error + ret, err := ps.CheckMasterOrgExists(args.morgId) + log.Info("SMK-executeOrgKeyAction @547 index is ", "ret", ret, "morgId", args.morgId, "err", err) + if (ret) { + return ErrMasterOrgExists + } + tx, err = ps.AddMasterOrg(args.morgId) + case AddSubOrg: + tx, err = ps.AddSubOrg(args.orgId, args.morgId) + case AddOrgVoter: + tx, err = ps.AddVoter(args.morgId, args.acctId) + case DeleteOrgVoter: + tx, err = ps.DeleteVoter(args.morgId, args.acctId) case AddOrgKey: - tx, err = ps.AddOrgKey(args.orgId, args.keyId) - case RemoveOrgKey: - tx, err = ps.DeleteOrgKey(args.orgId, args.keyId) + tx, err = ps.AddOrgKey(args.orgId, args.tmKey) + case DeleteOrgKey: + tx, err = ps.DeleteOrgKey(args.orgId, args.tmKey) + case ApprovePendingOp: + tx, err = ps.ApprovePendingOp(args.orgId) } if err != nil { log.Error("Failed to execute orgKey action", "action", action, "err", err) return ExecStatus{false, err.Error()} } log.Debug("executed orgKey action", "action", action, "tx", tx) - return ExecStatus{true, ""} + return ExecSuccess } // validateAccount validates the account and returns the wallet associated with that for signing the transaction -func (s *PermissionAPI) validateAccount(from common.Address) (accounts.Wallet, error) { +func (s *QuorumControlsAPI) validateAccount(from common.Address) (accounts.Wallet, error) { acct := accounts.Account{Address: from} w, err := s.acntMgr.Find(acct) if err != nil { @@ -558,7 +600,7 @@ func checkIsVoter(ps *pbind.PermissionsSession, acctId common.Address) bool { } // newPermSession creates a new permission contract session -func (s *PermissionAPI) newPermSession(w accounts.Wallet, txa ethapi.SendTxArgs) *pbind.PermissionsSession { +func (s *QuorumControlsAPI) newPermSession(w accounts.Wallet, txa ethapi.SendTxArgs) *pbind.PermissionsSession { frmAcct, transactOpts, gasLimit, gasPrice, nonce := s.getTxParams(txa, w) ps := &pbind.PermissionsSession{ Contract: s.permContr, @@ -577,7 +619,7 @@ func (s *PermissionAPI) newPermSession(w accounts.Wallet, txa ethapi.SendTxArgs) } // newClusterSession creates a new cluster contract session -func (s *PermissionAPI) newClusterSession(w accounts.Wallet, txa ethapi.SendTxArgs) *pbind.ClusterSession { +func (s *QuorumControlsAPI) newClusterSession(w accounts.Wallet, txa ethapi.SendTxArgs) *pbind.ClusterSession { frmAcct, transactOpts, gasLimit, gasPrice, nonce := s.getTxParams(txa, w) cs := &pbind.ClusterSession{ Contract: s.clustContr, @@ -596,7 +638,7 @@ func (s *PermissionAPI) newClusterSession(w accounts.Wallet, txa ethapi.SendTxAr } // getTxParams extracts the transaction related parameters -func (s *PermissionAPI) getTxParams(txa ethapi.SendTxArgs, w accounts.Wallet) (accounts.Account, *bind.TransactOpts, uint64, *big.Int, *big.Int) { +func (s *QuorumControlsAPI) getTxParams(txa ethapi.SendTxArgs, w accounts.Wallet) (accounts.Account, *bind.TransactOpts, uint64, *big.Int, *big.Int) { frmAcct := accounts.Account{Address: txa.From} transactOpts := bind.NewWalletTransactor(w, frmAcct) gasLimit := defaultGasLimit diff --git a/eth/backend.go b/eth/backend.go index 17d349a9c..013484022 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -329,19 +329,19 @@ func (s *Ethereum) APIs() []rpc.API { { Namespace: "quorumNodeMgmt", Version: "1.0", - Service: quorum.NewPermissionAPI(s.txPool, s.accountManager), + Service: quorum.NewQuorumControlsAPI(s.txPool, s.accountManager), Public: true, }, { Namespace: "quorumAcctMgmt", Version: "1.0", - Service: quorum.NewPermissionAPI(s.txPool, s.accountManager), + Service: quorum.NewQuorumControlsAPI(s.txPool, s.accountManager), Public: true, }, { Namespace: "quorumKeyMgmt", Version: "1.0", - Service: quorum.NewPermissionAPI(s.txPool, s.accountManager), + Service: quorum.NewQuorumControlsAPI(s.txPool, s.accountManager), Public: true, }, }...) diff --git a/internal/web3ext/web3ext.go b/internal/web3ext/web3ext.go index d6d62acdc..6154f3e13 100755 --- a/internal/web3ext/web3ext.go +++ b/internal/web3ext/web3ext.go @@ -793,17 +793,47 @@ web3._extend({ methods: [ new web3._extend.Method({ - name: 'addOrgKey', - call: 'quorumKeyMgmt_addOrgKey', + name: 'addMasterOrg', + call: 'quorumKeyMgmt_addMasterOrg', + params: 2, + inputFormatter: [null,web3._extend.formatters.inputTransactionFormatter] + }), + new web3._extend.Method({ + name: 'addSubOrg', + call: 'quorumKeyMgmt_addSubOrg', params: 3, inputFormatter: [null,null,web3._extend.formatters.inputTransactionFormatter] }), - new web3._extend.Method({ - name: 'removeOrgKey', - call: 'quorumKeyMgmt_removeOrgKey', + new web3._extend.Method({ + name: 'addVoter', + call: 'quorumKeyMgmt_addOrgVoter', params: 3, inputFormatter: [null,null,web3._extend.formatters.inputTransactionFormatter] }), + new web3._extend.Method({ + name: 'deleteVoter', + call: 'quorumKeyMgmt_deleteOrgVoter', + params: 3, + inputFormatter: [null,null,web3._extend.formatters.inputTransactionFormatter] + }), + new web3._extend.Method({ + name: 'addOrgKey', + call: 'quorumKeyMgmt_addOrgKey', + params: 2, + inputFormatter: [null,web3._extend.formatters.inputTransactionFormatter] + }), + new web3._extend.Method({ + name: 'deleteOrgKey', + call: 'quorumKeyMgmt_deleteOrgKey', + params: 2, + inputFormatter: [null,web3._extend.formatters.inputTransactionFormatter] + }), + new web3._extend.Method({ + name: 'approvePendingOp', + call: 'quorumKeyMgmt_approvePendingOp', + params: 2, + inputFormatter: [null,web3._extend.formatters.inputTransactionFormatter] + }), ], properties: [