Skip to content

Commit

Permalink
Improve performance of _contribute() (fixes #12)
Browse files Browse the repository at this point in the history
  • Loading branch information
sembrestels committed Oct 26, 2021
1 parent 7f70936 commit 0157e03
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions contracts/Hatch.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ contract Hatch is EtherTokenConstant, IsContract, AragonApp, IACLOracle {
string private constant ERROR_INVALID_PCT = "HATCH_INVALID_PCT";
string private constant ERROR_INVALID_STATE = "HATCH_INVALID_STATE";
string private constant ERROR_INVALID_CONTRIBUTE_VALUE = "HATCH_INVALID_CONTRIBUTE_VALUE";
string private constant ERROR_INSUFFICIENT_BALANCE = "HATCH_INSUFFICIENT_BALANCE";
string private constant ERROR_INSUFFICIENT_ALLOWANCE = "HATCH_INSUFFICIENT_ALLOWANCE";
string private constant ERROR_NOTHING_TO_REFUND = "HATCH_NOTHING_TO_REFUND";
string private constant ERROR_TOKEN_TRANSFER_REVERTED = "HATCH_TOKEN_TRANSFER_REVERTED";

Expand Down Expand Up @@ -293,8 +291,6 @@ contract Hatch is EtherTokenConstant, IsContract, AragonApp, IACLOracle {

// (contributor) ~~~> contribution tokens ~~~> (hatch)
if (contributionToken != ETH) {
require(ERC20(contributionToken).balanceOf(_contributor) >= value, ERROR_INSUFFICIENT_BALANCE);
require(ERC20(contributionToken).allowance(_contributor, address(this)) >= value, ERROR_INSUFFICIENT_ALLOWANCE);
_transfer(contributionToken, _contributor, address(this), value);
}
// (mint ✨) ~~~> project tokens ~~~> (contributor)
Expand Down

0 comments on commit 0157e03

Please sign in to comment.