Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions contracts/AppCoinsCreditsBalance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ contract AppCoinsCreditsBalance is Whitelist {
function depositFunds(uint _amount, bytes _merkleTreeHash)
public
onlyIfWhitelisted("depositFunds", msg.sender){
require(appc.allowance(msg.sender, address(this)) >= _amount);

registerBalanceProof(_merkleTreeHash);

appc.transferFrom(msg.sender, address(this), _amount);
balance = SafeMath.add(balance,_amount);

require(appc.allowance(msg.sender, address(this)) >= _amount);
appc.transferFrom(msg.sender, address(this), _amount);

emit Deposit(_amount);
}

Expand Down
4 changes: 3 additions & 1 deletion contracts/AppCoinsTimelock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ contract AppCoinsTimelock {
@param _amount uint of the amount to be stored
*/
function allocateFunds(address _address, uint256 _amount) public {

balances[_address] = SafeMath.add(balances[_address], _amount);

require(appc.allowance(msg.sender, address(this)) >= _amount);

appc.transferFrom(msg.sender, address(this), _amount);
balances[_address] = SafeMath.add(balances[_address], _amount);

emit NewFundsAllocated(_address, balances[_address]);
}
Expand Down