Compare commits
1 Commits
master
...
feature/co
Author | SHA1 | Date | |
---|---|---|---|
c5f98a1b69 |
@ -1,8 +1,14 @@
|
|||||||
pragma solidity ^0.4.24;
|
pragma solidity ^0.4.24;
|
||||||
|
|
||||||
import "@aragon/os/contracts/apps/AragonApp.sol";
|
import "@aragon/os/contracts/apps/AragonApp.sol";
|
||||||
|
import "@aragon/os/contracts/kernel/IKernel.sol";
|
||||||
|
|
||||||
|
interface ITokenBalance {
|
||||||
|
function balanceOf(address contributorAccount) public view returns (uint256);
|
||||||
|
}
|
||||||
contract Contributor is AragonApp {
|
contract Contributor is AragonApp {
|
||||||
|
bytes32 public constant KERNEL_APP_ADDR_NAMESPACE = 0xd6f028ca0e8edb4a8c9757ca4fdccab25fa1e0317da1188108f7d2dee14902fb;
|
||||||
|
|
||||||
bytes32 public constant MANAGE_CONTRIBUTORS_ROLE = keccak256("MANAGE_CONTRIBUTORS_ROLE");
|
bytes32 public constant MANAGE_CONTRIBUTORS_ROLE = keccak256("MANAGE_CONTRIBUTORS_ROLE");
|
||||||
|
|
||||||
struct Contributor {
|
struct Contributor {
|
||||||
@ -40,6 +46,12 @@ contract Contributor is AragonApp {
|
|||||||
initialized();
|
initialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getTokenContract() public view returns (address) {
|
||||||
|
IKernel k = IKernel(kernel());
|
||||||
|
|
||||||
|
return k.getApp(KERNEL_APP_ADDR_NAMESPACE, appIds[uint8(Apps.Token)]);
|
||||||
|
}
|
||||||
|
|
||||||
function coreContributorsCount() view public returns (uint) {
|
function coreContributorsCount() view public returns (uint) {
|
||||||
uint count = 0;
|
uint count = 0;
|
||||||
for (uint256 i = 1; i <= contributorsCount; i++) {
|
for (uint256 i = 1; i <= contributorsCount; i++) {
|
||||||
@ -113,7 +125,7 @@ contract Contributor is AragonApp {
|
|||||||
return contributors[id];
|
return contributors[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getContributorById(uint _id) public view returns (uint id, address account, bytes32 ipfsHash, uint8 hashFunction, uint8 hashSize, bool isCore, bool exists ) {
|
function getContributorById(uint _id) public view returns (uint id, address account, bytes32 ipfsHash, uint8 hashFunction, uint8 hashSize, bool isCore, uint256 balance, bool exists ) {
|
||||||
id = _id;
|
id = _id;
|
||||||
Contributor storage c = contributors[_id];
|
Contributor storage c = contributors[_id];
|
||||||
account = c.account;
|
account = c.account;
|
||||||
@ -121,6 +133,8 @@ contract Contributor is AragonApp {
|
|||||||
hashFunction = c.hashFunction;
|
hashFunction = c.hashFunction;
|
||||||
hashSize = c.hashSize;
|
hashSize = c.hashSize;
|
||||||
isCore = c.isCore;
|
isCore = c.isCore;
|
||||||
|
address token = getTokenContract();
|
||||||
|
balance = ITokenBalance(token).balanceOf(c.account);
|
||||||
exists = c.exists;
|
exists = c.exists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user