Skip to content
Permalink
Browse files

feat(kleros): add withdraw and transfer functions

  • Loading branch information...
satello committed Jul 30, 2018
1 parent a75933d commit eba67589544bbb9f9b1a539059f76f5c5189c227
@@ -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
Oops, something went wrong.

0 comments on commit eba6758

Please sign in to comment.
You can’t perform that action at this time.