Skip to content

Commit

Permalink
STOContract, style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
enkogu committed Feb 7, 2019
1 parent 6cc1a1d commit a15ecfb
Show file tree
Hide file tree
Showing 9 changed files with 600 additions and 518 deletions.
670 changes: 283 additions & 387 deletions contracts/Daico/Daico.sol

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions contracts/Daico/IDaico.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ pragma solidity ^0.4.24;


contract IDaico {
function addInvestor(uint _amount, address _investorAddress) public;
function vote(bool _vote) external;
function proposeNewRoadmap(uint[] _tapFunds, uint[] _tapDurations) external;
}
31 changes: 31 additions & 0 deletions contracts/Daico/STOContract.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
pragma solidity ^0.4.24;

import "zeppelin-solidity/contracts/token/ERC20/MintableToken.sol";
import "zeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import "./IDaico.sol";


contract STOContract is MintableToken {
address public ervercityTokenAddress;
address public daicoAddress;

constructor(address _ervercityTokenAddress) public {
ervercityTokenAddress = _ervercityTokenAddress;
}

function setDaicoAddress(address _daicoAddress) public onlyOwner {
daicoAddress = _daicoAddress;
}

function invest(uint _amount) public {
ERC20(ervercityTokenAddress).transferFrom(msg.sender, address(this), _amount);
ERC20(ervercityTokenAddress).approve(daicoAddress, _amount);

totalSupply_ = totalSupply_.add(_amount);
balances[msg.sender] = balances[msg.sender].add(_amount);
emit Mint(msg.sender, _amount);
emit Transfer(address(0), msg.sender, _amount);

IDaico(daicoAddress).addInvestor(_amount, msg.sender);
}
}
275 changes: 206 additions & 69 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"growl": "^1.10.0",
"moment": "^2.22.2",
"solidity-coverage": "^0.5.5",
"truffle": "^4.1.8",
"truffle": "^4.1.15",
"truffle-hdwallet-provider": "0.0.5",
"utf8": "^3.0.0",
"zeppelin-solidity": "^1.9.0"
Expand Down
Loading

0 comments on commit a15ecfb

Please sign in to comment.