Intercoin / ControlContract

Lets a community collectively manage a wallet and tokens, including enforcing limits and lockups.
https://intercoin.org
GNU Affero General Public License v3.0
0 stars 3 forks source link

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:

method name called by description
init anyone should be executed by the creator immediately after deployment. can be executed only the one time
addMethod owner setup method, fraction, minimum and roles to invoke/endorse
invoke member who can invoke (see allowInvoke) initiating transaction
endorse member who can endorse (see allowEndorse) endorsing transaction

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

Contracts MD

ControlContract.md
ControlContract.md