pragma solidity ^0.4.18; import "./Avatar.sol"; import "./Reputation.sol"; import "./DAOToken.sol"; import "../globalConstraints/GlobalConstraintInterface.sol"; /** * @title Controller contract * @dev A controller controls the organizations tokens ,reputation and avatar. * It is subject to a set of schemes and constraints that determine its behavior. * Each scheme has it own parameters and operation permissions. */ interface ControllerInterface { /** * @dev mint reputation . * @param _amount amount of reputation to mint * @param _beneficiary beneficiary address * @param _avatar address * @return bool which represents a success */ function mintReputation(int256 _amount, address _beneficiary,address _avatar) public returns(bool); /** * @dev mint tokens . * @param _amount amount of token to mint * @param _beneficiary beneficiary address * @param _avatar address * @return bool which represents a success */ function mintTokens(uint256 _amount, address _beneficiary,address _avatar) public returns(bool); /** * @dev register or update a scheme * @param _scheme the address of the scheme * @param _paramsHash a hashed configuration of the usage of the scheme * @param _permissions the permissions the new scheme will have * @param _avatar address * @return bool which represents a success */ function registerScheme(address _scheme, bytes32 _paramsHash, bytes4 _permissions,address _avatar) public returns(bool); /** * @dev unregister a scheme * @param _avatar address * @param _scheme the address of the scheme * @return bool which represents a success */ function unregisterScheme(address _scheme,address _avatar) public returns(bool); /** * @dev unregister the caller's scheme * @param _avatar address * @return bool which represents a success */ function unregisterSelf(address _avatar) public returns(bool); function isSchemeRegistered( address _scheme,address _avatar) public constant returns(bool); function getSchemeParameters(address _scheme,address _avatar) public constant returns(bytes32); function getSchemePermissions(address _scheme,address _avatar) public constant returns(bytes4); // Global Contraints: function globalConstraintsCount(address _avatar) public constant returns(uint); function isGlobalConstraintRegistered(address _globalConstraint,address _avatar) public constant returns(bool); /** * @dev add or update Global Constraint * @param _globalConstraint the address of the global constraint to be added. * @param _params the constraint parameters hash. * @param _avatar address * @return bool which represents a success */ function addGlobalConstraint(address _globalConstraint, bytes32 _params,address _avatar) public returns(bool); /** * @dev remove Global Constraint * @param _globalConstraint the address of the global constraint to be remove. * @param _avatar address * @return bool which represents a success */ function removeGlobalConstraint (address _globalConstraint,address _avatar) public returns(bool); /** * @dev upgrade the Controller * The function will trigger an event 'UpgradeController'. * @param _newController the address of the new controller. * @param _avatar address * @return bool which represents a success */ function upgradeController(address _newController,address _avatar) public returns(bool); /** * @dev do a generic delegate call to the contract which called us. * This function use delegatecall and might expose the organization to security * risk. Use this function only if you really knows what you are doing. * @param _params the params for the call. * @param _avatar address * @return bool which represents success */ function genericAction(bytes32[] _params,address _avatar) public returns(bool); /** * @dev send some ether * @param _amountInWei the amount of ether (in Wei) to send * @param _to address of the beneficiary * @param _avatar address * @return bool which represents a success */ function sendEther(uint _amountInWei, address _to,address _avatar) public returns(bool); /** * @dev send some amount of arbitrary ERC20 Tokens * @param _externalToken the address of the Token Contract * @param _to address of the beneficiary * @param _value the amount of ether (in Wei) to send * @param _avatar address * @return bool which represents a success */ function externalTokenTransfer(StandardToken _externalToken, address _to, uint _value,address _avatar) public returns(bool); /** * @dev transfer token "from" address "to" address * One must to approve the amount of tokens which can be spend from the * "from" account.This can be done using externalTokenApprove. * @param _externalToken the address of the Token Contract * @param _from address of the account to send from * @param _to address of the beneficiary * @param _value the amount of ether (in Wei) to send * @param _avatar address * @return bool which represents a success */ function externalTokenTransferFrom(StandardToken _externalToken, address _from, address _to, uint _value,address _avatar) public returns(bool); /** * @dev increase approval for the spender address to spend a specified amount of tokens * on behalf of msg.sender. * @param _externalToken the address of the Token Contract * @param _spender address * @param _addedValue the amount of ether (in Wei) which the approval is referring to. * @param _avatar address * @return bool which represents a success */ function externalTokenIncreaseApproval(StandardToken _externalToken, address _spender, uint _addedValue,address _avatar) public returns(bool); /** * @dev decrease approval for the spender address to spend a specified amount of tokens * on behalf of msg.sender. * @param _externalToken the address of the Token Contract * @param _spender address * @param _subtractedValue the amount of ether (in Wei) which the approval is referring to. * @param _avatar address * @return bool which represents a success */ function externalTokenDecreaseApproval(StandardToken _externalToken, address _spender, uint _subtractedValue,address _avatar) public returns(bool); }