-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAppExampleN.sol
36 lines (27 loc) · 1.01 KB
/
AppExampleN.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
pragma solidity ^0.4.9;
import "lib/ethereans/management/Owned.sol";
import "lib/ethereans/token/Token.sol";
import "./normal/MyAppTokenFactoryNI.sol";
contract AppExampleN is Owned {
MyAppTokenFactoryNI public myTokenFactory;
MyAppTokenI public myToken;
mapping (uint => MyAppTokenI) public userProjectToken;
uint public projectCount = 0;
function AppExampleN(MyAppTokenFactoryNI _myTokenFactory){
myTokenFactory = _myTokenFactory;
myToken = myTokenFactory.newAppToken();
}
function createProject(string _name) {
userProjectToken[projectCount] = myTokenFactory.newProjectToken(_name);
projectCount++;
}
function mint(uint _project, address _to, uint _amount) only_owner {
userProjectToken[_project].mint(_to,_amount);
}
function mint(address _to, uint _amount) only_owner{
myToken.mint(_to,_amount);
}
function isOwned(uint _project) returns (address){
return userProjectToken[_project].getOwner();
}
}