Skip to content

Commit

Permalink
makes all payable functions payable as needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeylin committed Apr 16, 2019
1 parent 128b4c0 commit 7cbba1b
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion contracts/BountiesMetaTxRelayer.sol
Expand Up @@ -25,7 +25,6 @@ contract BountiesMetaTxRelayer {
uint _tokenVersion,
uint _nonce)
public
payable
returns (uint)
{
bytes32 metaHash = keccak256(abi.encodePacked(address(this),
Expand Down Expand Up @@ -54,6 +53,61 @@ contract BountiesMetaTxRelayer {
_tokenVersion);
}

function metaIssueAndContribute(
bytes memory signature,
address payable [] memory _issuers,
address [] memory _approvers,
string memory _data,
uint _deadline,
address _token,
uint _tokenVersion,
uint _depositAmount,
uint _nonce)
public
payable
returns (uint)
{
bytes32 metaHash = keccak256(abi.encodePacked(address(this),
"metaIssueAndContribute",
_issuers,
_approvers,
_data,
_deadline,
_token,
_tokenVersion,
_depositAmount,
_nonce));
address signer = getSigner(metaHash, signature);

//make sure signer doesn't come back as 0x0
require(signer != address(0));
require(_nonce == replayNonce[signer]);

//increase the nonce to prevent replay attacks
replayNonce[signer]++;

if (msg.value > 0){
return bountiesContract.issueAndContribute.value(msg.value)(address(uint160(signer)),
_issuers,
_approvers,
_data,
_deadline,
_token,
_tokenVersion,
_depositAmount);
} else {
return bountiesContract.issueAndContribute(address(uint160(signer)),
_issuers,
_approvers,
_data,
_deadline,
_token,
_tokenVersion,
_depositAmount);
}

}

function metaContribute(
bytes memory _signature,
uint _bountyId,
Expand Down

0 comments on commit 7cbba1b

Please sign in to comment.