AppIds are used to lookup the actual contract addresses of each app. Because of different registry names (open.aragonpm.eth vs. aragonpm.eth) we have to use different ids in the local dev chain and in the testnet/mainnet. To allow this we need to set the appids dynamically. There is an open aragon issue to solve this and also allow to use open.aragonpm.eth in the devchain by default. https://github.com/aragon/aragen/issues/10
26 lines
772 B
Solidity
26 lines
772 B
Solidity
pragma solidity ^0.4.24;
|
|
|
|
import "@aragon/os/contracts/apps/AragonApp.sol";
|
|
import "./ERC20Token.sol";
|
|
|
|
contract Token is ERC20Token, AragonApp {
|
|
bytes32 public constant MINT_TOKEN_ROLE = keccak256("MINT_TOKEN_ROLE");
|
|
|
|
// ensure alphabetic order
|
|
enum Apps { Contribution, Contributor, Proposal, Token }
|
|
bytes32[4] public appIds;
|
|
|
|
event LogMint(address indexed recipient, uint256 amount, uint256 contributionId);
|
|
|
|
function initialize(bytes32[4] _appIds) public onlyInit {
|
|
appIds = _appIds;
|
|
initialized();
|
|
}
|
|
|
|
function mintFor(address contributorAccount, uint256 amount, uint256 contributionId) public isInitialized auth(MINT_TOKEN_ROLE) {
|
|
_mint(contributorAccount, amount);
|
|
emit LogMint(contributorAccount, amount, contributionId);
|
|
}
|
|
|
|
}
|