Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Merge d307d02 into a75933d
Browse files Browse the repository at this point in the history
  • Loading branch information
satello committed Jul 30, 2018
2 parents a75933d + d307d02 commit 33c582d
Show file tree
Hide file tree
Showing 3 changed files with 802 additions and 714 deletions.
22 changes: 22 additions & 0 deletions src/contracts/implementations/PNK/MiniMePinakion.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,28 @@ class MiniMePinakion extends ContractImplementation {
throw new Error(errorConstants.UNABLE_TO_TRANSFER_OWNERSHIP)
}
}

/**
* Approve the arbitrator contract to transfer PNK to the contract and call the arbitrators
* receiveApproval()
* @param {string} arbitratorAddress - The address of the arbitrator contract.
* @param {number} amount - The amount of PNK to transfer.
* @param {string} account - The users account.
* @returns {bool} If the transfer succeeded or not
*/
approveAndCall = async (arbitratorAddress, amount, account = this._Web3Wrapper.getAccount(0)) => {
await this.loadContract()

return this.contractInstance.approveAndCall(
arbitratorAddress,
this._Web3Wrapper.toWei(amount, 'ether'),
'0x0',
{
from: account,
gas: ethConstants.TRANSACTION.GAS
}
)
}
}

export default MiniMePinakion

0 comments on commit 33c582d

Please sign in to comment.