Vault app #145

Closed
haythem96 wants to merge 10 commits from features/app-vault into master
Showing only changes of commit 03995f194e - Show all commits

View File

@@ -34,6 +34,7 @@ contract Vault is EtherTokenConstant, AragonApp, DepositableStorage {
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
bytes32[4] public appIds;
event VaultDeposit(address indexed token, address indexed sender, uint256 amount);
event VaultWithdraw(address indexed token, address indexed receiver, uint256 amount);
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
function () external payable isInitialized {
_deposit(ETH, msg.value);
@@ -100,6 +101,17 @@ contract Vault is EtherTokenConstant, AragonApp, DepositableStorage {
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
_deposit(_token, _value);
}
function withdraw(address _token) external payable isInitialized {
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
uint256 contributorFundPercentage = (balanceOf(msg.sender) * 100) / totalSupply();
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
//to check if sender is a contributor
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
require(contributorFundPercentage > 0, "Contributor have no fund");
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
uint256 contributorFund = (address(this).balance * contributorFundPercentage) / 100;
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
msg.sender.transfer(contributorFund);
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
emit VaultWithdraw(_token, msg.sender, contributorFund);
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
}
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
function balance(address _token) public view returns (uint256) {
if (_token == ETH) {
return address(this).balance;
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?
haythem96 commented 2019-07-26 15:31:11 +00:00 (Migrated from github.com)
Review

@bumi we should burn the tokens here for the contributor that withdraw, right ?

@bumi we should burn the tokens here for the contributor that withdraw, right ?