@intercoin/control
v1.0.2
Published
Smart contract providing the collectively way to manage by calling any method from external contract
Downloads
1
Readme
ControlContract
Lets a community collectively manage a wallet and tokens by calliing any method from external contract
Deploy
when deploy it is no need to pass parameters in to constructor, but need to run method init immediately after deploy
Once installed will be use methods:
Methods
init
should be executed by creator immediately after deploy. can be executed only the one time
Params: name | type | description --|--|-- communityAddr|address|address of community contract GroupRolesSetting[]|tuple| array of groups. Each group should contain two roles: who can invoke and who can endorse.[[invokeRoleGroup1,endorseRoleGroup1], ...]
invoke
method will initiate a creation transaction. return invokeID
- invoke identificator and invokeIDWei
- value in wei that can be send to contract directly to endorse
Params:
name | type | description
--|--|--
contractAddress|address|address of external token
method|hexadecimal string|method of external token that would be executed
params|hexadecimal string|params of external token's method
endorse
endorsed transaction by invokeID
Params:
name | type | description
--|--|--
invokeID|uint256|invoke identificator
addMethod
allow participant with invokeRoleName
/endorseRoleName
to invoke/endorse transaction with method
of contractAddress
Note that attemptштп add method with different fraction/minimum will revert. so can be added only one time. But roles can be added it any time, just add the same fraction/minimum
Params:
name | type | description
--|--|--
contractAddress|address|address of external token
method|hexadecimal string|method of external token that would be executed
invokeRoleName|string| invoke role name
endorseRoleName|string| endorse role name
minimum|uint256|minimum
fraction|uint256|fraction value mul by 1e10
Events
OperationInvoked
happens while calling method invoke Params: name | type | description --|--|-- invokeID|uint256|invokeID invokeIDWei|uint40|invokeIDWei contractAddress|address| token's address method|hexadecimal string| method of external token that would be executed params|hexadecimal string| method's params
OperationEndorsed
happens while calling method endorse or sending eth directly to contract Params: name | type | description --|--|-- invokeID|uint256|invokeID invokeIDWei|uint40|invokeIDWei
OperationExecuted
happens when transaction should be executed Params: name | type | description --|--|-- invokeID|uint256|invokeID invokeIDWei|uint40|invokeIDWei
HeartBeat
happens when active group do smth Params: name | type | description --|--|-- groupIndex|uint256|group's index that has been active now time|uint256|timestamp in GMT time
CurrentGroupIndexChanged
happens when group regained ownership Params: name | type | description --|--|-- from|uint256|group index of old owner to|uint256|group index of new owner time|uint256|timestamp in GMT time