Vault app #145

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

View File

@ -8,104 +8,155 @@ import "@aragon/os/contracts/common/SafeERC20.sol";
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 ?
import "@aragon/os/contracts/lib/token/ERC20.sol";
interface IContributor {
function getContributorAddressById(uint32 id) view public returns (address);
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 contributorsCount() view public returns (uint32);
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 ?
}
interface IToken {
function balanceOf(address owner) public view returns (uint256);
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 balanceOf(address owner) public view returns (uint256);
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 totalSupply() public view returns (uint256);
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 ?
}
contract Vault is EtherTokenConstant, AragonApp, DepositableStorage {
using SafeERC20 for ERC20;
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 ?
using SafeERC20 for ERC20;
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 ?
string private constant ERROR_NOT_DEPOSITABLE = "VAULT_NOT_DEPOSITABLE";
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 ?
string private constant ERROR_DEPOSIT_VALUE_ZERO = "VAULT_DEPOSIT_VALUE_ZERO";
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 ?
string private constant ERROR_VALUE_MISMATCH = "VAULT_VALUE_MISMATCH";
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 ?
string private constant ERROR_TOKEN_TRANSFER_FROM_REVERTED = "VAULT_TOKEN_TRANSFER_FROM_REVERT";
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 ?
string private constant ERROR_NOT_DEPOSITABLE = "VAULT_NOT_DEPOSITABLE";
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 ?
string private constant ERROR_DEPOSIT_VALUE_ZERO = "VAULT_DEPOSIT_VALUE_ZERO";
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 ?
string private constant ERROR_VALUE_MISMATCH = "VAULT_VALUE_MISMATCH";
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 ?
string private constant ERROR_TOKEN_TRANSFER_FROM_REVERTED = "VAULT_TOKEN_TRANSFER_FROM_REVERT";
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 private _snapshotTotalBalance;
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 private _snapshotTotalSupply;
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 ?
mapping (address => uint256) private _snapshotBalances;
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 ?
mapping (address => uint256) private _snapshotBalances;
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 ?
// ensure alphabetic order
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 ?
enum Apps { Contribution, Contributor, Proposal, Token }
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;
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 ?
// ensure alphabetic order
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 ?
enum Apps { Contribution, Contributor, Proposal, Token }
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;
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 ?
event VaultDeposit(address indexed token, address indexed sender, 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 ?
event VaultDeposit(address indexed token, address indexed sender, 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 {
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(ETH, msg.value);
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 {
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(ETH, msg.value);
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 ?
/**
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 ?
* @notice Initialize Vault app
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 ?
* @dev As an AragonApp it needs to be initialized in order for roles (`auth` and `authP`) to work
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 initialize(bytes32[4] _appIds) external onlyInit {
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 ?
initialized();
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 ?
appIds = _appIds;
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 ?
setDepositable(true);
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 getTokenContract() public view returns (address) {
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 ?
IKernel k = IKernel(kernel());
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 ?
return k.getApp(KERNEL_APP_ADDR_NAMESPACE, appIds[uint8(Apps.Token)]);
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 getContributorContract() public view returns (address) {
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 ?
IKernel k = IKernel(kernel());
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 ?
return k.getApp(KERNEL_APP_ADDR_NAMESPACE, appIds[uint8(Apps.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 ?
}
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 getContributorAddressById(uint32 contributorId) public view returns (address) {
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 ?
address contributor = getContributorContract();
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 ?
return IContributor(contributor).getContributorAddressById(contributorId);
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 getContributorsAddresses() internal view returns (address[]) {
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 ?
address contributor = getContributorContract();
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 ?
uint32 contributorsCount = IContributor(contributor).contributorsCount();
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 ?
address[] memory contributorsAddresses = new address[](contributorsCount);
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 ?
for(uint32 i = 1; i <= contributorsCount; i++) {
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 ?
address contributorAddress = IContributor(contributor).getContributorAddressById(i);
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 ?
contributorsAddresses[i-1] = contributorAddress;
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 ?
* @notice Initialize Vault app
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 ?
* @dev As an AragonApp it needs to be initialized in order for roles (`auth` and `authP`) to work
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 ?
return contributorsAddresses;
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 balanceOf(address owner) public view returns (uint256) {
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 ?
address token = getTokenContract();
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 ?
return IToken(token).balanceOf(owner);
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 totalSupply() public view returns (uint256) {
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 ?
address token = getTokenContract();
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 ?
return IToken(token).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 ?
}
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 ?
* @notice Deposit `_value` `_token` to the vault
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 ?
* @param _token Address of the token being transferred
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 ?
* @param _value Amount of tokens being transferred
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 deposit(address _token, uint256 _value) 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 ?
_deposit(_token, _value);
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) {
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 ?
if (_token == ETH) {
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 ?
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 ?
} else {
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 ?
return ERC20(_token).staticBalanceOf(address(this));
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 ?
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 ?
* @dev Disable recovery escape hatch, as it could be used
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 ?
* maliciously to transfer funds away from the vault
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 allowRecoverability(address) public view returns (bool) {
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 ?
return false;
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 _deposit(address _token, uint256 _value) internal {
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(isDepositable(), ERROR_NOT_DEPOSITABLE);
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(_value > 0, ERROR_DEPOSIT_VALUE_ZERO);
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 ?
if (_token == ETH) {
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 is implicit in this case
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(msg.value == _value, ERROR_VALUE_MISMATCH);
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 ?
} else {
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(
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 ?
ERC20(_token).safeTransferFrom(msg.sender, address(this), _value),
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 ?
ERROR_TOKEN_TRANSFER_FROM_REVERTED
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 initialize(bytes32[4] _appIds) external onlyInit {
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 ?
initialized();
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 ?
appIds = _appIds;
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 ?
setDepositable(true);
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 ?
if (_token == ETH) {
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 is implicit in this case
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(msg.value == _value, ERROR_VALUE_MISMATCH);
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 ?
createSnapshot();
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 VaultDeposit(_token, msg.sender, _value);
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 getTokenContract() public view returns (address) {
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 ?
IKernel k = IKernel(kernel());
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 createSnapshot() internal {
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 ?
updateSnapshotTotalSupply();
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 ?
updateSnapshotBalances();
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 ?
return k.getApp(KERNEL_APP_ADDR_NAMESPACE, appIds[uint8(Apps.Token)]);
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 getContributorContract() public view returns (address) {
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 ?
IKernel k = IKernel(kernel());
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 ?
return k.getApp(KERNEL_APP_ADDR_NAMESPACE, appIds[uint8(Apps.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 ?
}
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 ?
* @notice Deposit `_value` `_token` to the vault
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 ?
* @param _token Address of the token being transferred
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 ?
* @param _value Amount of tokens being transferred
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 deposit(address _token, uint256 _value) 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 ?
_deposit(_token, _value);
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) {
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 ?
if (_token == ETH) {
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 ?
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 ?
} else {
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 ?
return ERC20(_token).staticBalanceOf(address(this));
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 ?
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 ?
* @dev Disable recovery escape hatch, as it could be used
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 ?
* maliciously to transfer funds away from the vault
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 allowRecoverability(address) public view returns (bool) {
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 ?
return false;
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 _deposit(address _token, uint256 _value) internal {
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(isDepositable(), ERROR_NOT_DEPOSITABLE);
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(_value > 0, ERROR_DEPOSIT_VALUE_ZERO);
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 ?
if (_token == ETH) {
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 is implicit in this case
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(msg.value == _value, ERROR_VALUE_MISMATCH);
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 ?
} else {
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(
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 ?
ERC20(_token).safeTransferFrom(msg.sender, address(this), _value),
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 ?
ERROR_TOKEN_TRANSFER_FROM_REVERTED
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 ?
*/
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 ?
if (_token == ETH) {
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 is implicit in this case
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(msg.value == _value, ERROR_VALUE_MISMATCH);
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 VaultDeposit(_token, msg.sender, _value);
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 updateSnapshotTotalSupply() internal {
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 ?
_snapshotTotalSupply = 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 ?
}
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 updateSnapshotBalances() internal {
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 ?
address[] memory contributorsAddresses = getContributorsAddresses();
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 ?
for(uint32 i = 0; i < contributorsAddresses.length; i++) {
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 ?
_snapshotBalances[contributorsAddresses[i]] = balanceOf(contributorsAddresses[i]);
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 ?
}