2018-03-30 05:31:08 +00:00
|
|
|
pragma solidity ^0.4.21;
|
2018-01-09 01:00:07 +00:00
|
|
|
|
|
|
|
contract ERC725 {
|
|
|
|
|
|
|
|
uint256 constant MANAGEMENT_KEY = 1;
|
|
|
|
uint256 constant ACTION_KEY = 2;
|
|
|
|
uint256 constant CLAIM_SIGNER_KEY = 3;
|
|
|
|
uint256 constant ENCRYPTION_KEY = 4;
|
2018-02-21 21:17:38 +00:00
|
|
|
|
|
|
|
event KeyAdded(bytes32 indexed key, uint256 indexed purpose, uint256 indexed keyType);
|
|
|
|
event KeyRemoved(bytes32 indexed key, uint256 indexed purpose, uint256 indexed keyType);
|
|
|
|
event ExecutionRequested(uint256 indexed executionId, address indexed to, uint256 indexed value, bytes data);
|
|
|
|
event Executed(uint256 indexed executionId, address indexed to, uint256 indexed value, bytes data);
|
2018-04-25 12:45:27 +00:00
|
|
|
event ExecutionFailed(uint256 indexed executionId, address indexed to, uint256 indexed value, bytes data);
|
2018-02-21 21:17:38 +00:00
|
|
|
event Approved(uint256 indexed executionId, bool approved);
|
2018-01-09 01:00:07 +00:00
|
|
|
|
2018-02-21 21:17:38 +00:00
|
|
|
struct Key {
|
|
|
|
uint256 purpose; //e.g., MANAGEMENT_KEY = 1, ACTION_KEY = 2, etc.
|
|
|
|
uint256 keyType; // e.g. 1 = ECDSA, 2 = RSA, etc.
|
|
|
|
bytes32 key;
|
|
|
|
}
|
2018-01-09 01:00:07 +00:00
|
|
|
|
2018-03-30 05:31:08 +00:00
|
|
|
function getKey(bytes32 _key, uint256 _purpose) public view returns(uint256 purpose, uint256 keyType, bytes32 key);
|
|
|
|
function getKeyPurpose(bytes32 _key) public view returns(uint256[] purpose);
|
|
|
|
function getKeysByPurpose(uint256 _purpose) public view returns(bytes32[] keys);
|
2018-02-21 21:17:38 +00:00
|
|
|
function addKey(bytes32 _key, uint256 _purpose, uint256 _keyType) public returns (bool success);
|
2018-03-02 05:25:46 +00:00
|
|
|
function removeKey(bytes32 _key, uint256 _purpose) public returns (bool success);
|
2018-02-21 21:17:38 +00:00
|
|
|
function execute(address _to, uint256 _value, bytes _data) public returns (uint256 executionId);
|
|
|
|
function approve(uint256 _id, bool _approve) public returns (bool success);
|
2018-01-09 01:00:07 +00:00
|
|
|
}
|