From 21d3341d157d1ac4f69ce80610e81306807620b0 Mon Sep 17 00:00:00 2001 From: Daniel Lehrner Date: Wed, 17 Jul 2019 11:54:46 +0200 Subject: [PATCH] changed some error messages --- README.md | 2 +- contracts/Fundable.sol | 8 ++++---- test/Fundable.js | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7e688ac..ee5ea37 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Coverage Status](https://coveralls.io/repos/github/IoBuilders/fundable-token/badge.svg?branch=master)](https://coveralls.io/github/IoBuilders/fundable-token?branch=master) [![npm](https://img.shields.io/npm/v/eip2019.svg)](https://www.npmjs.com/package/eip2019) -This is the work in progress implementation of [EIP-2019 Fundable token](https://github.com/ethereum/EIPs/pull/2019/files). This implementation will change over time with the standard and is not stable at the moment. +This is the reference implementation of [EIP-2019 Fundable token](https://github.com/ethereum/EIPs/pull/2019/files). This implementation will change over time with the standard and is not stable at the moment. Feedback is appreciated and can given at [the discussion of the EIP](https://github.com/ethereum/EIPs/issues/2019). diff --git a/contracts/Fundable.sol b/contracts/Fundable.sol index 05c29d9..564ce35 100644 --- a/contracts/Fundable.sol +++ b/contracts/Fundable.sol @@ -17,7 +17,7 @@ contract Fundable is IFundable, ERC20 { } address public tokenOperator; - // walletToFund -> autorized -> true/false + // walletToFund -> authorized -> true/false mapping(address => mapping(address => bool)) public fundOperators; mapping(bytes32 => FundableData) private orderedFunds; @@ -76,7 +76,7 @@ contract Fundable is IFundable, ERC20 { function cancelFund(string calldata operationId) external returns (bool) { FundableData storage fund = orderedFunds[operationId.toHash()]; require(fund.status == FundStatusCode.Ordered, "A fund can only be cancelled in status Ordered"); - require(fund.walletToFund == msg.sender || fund.orderer == msg.sender, "Only the wallet who receive the fund can cancel"); + require(fund.walletToFund == msg.sender || fund.orderer == msg.sender, "Only the wallet who receives the fund can cancel"); fund.status = FundStatusCode.Cancelled; emit FundCancelled(fund.orderer, operationId); return true; @@ -85,7 +85,7 @@ contract Fundable is IFundable, ERC20 { function processFund(string calldata operationId) external returns (bool) { require(tokenOperator == msg.sender, "A fund can only be processed by the fund operator"); FundableData storage fund = orderedFunds[operationId.toHash()]; - require(fund.status == FundStatusCode.Ordered, "Only process if the status is ordered"); + require(fund.status == FundStatusCode.Ordered, "A fund can only be put in process from status Ordered"); fund.status = FundStatusCode.InProcess; emit FundInProcess(fund.orderer, operationId); return true; @@ -148,7 +148,7 @@ contract Fundable is IFundable, ERC20 { ) private returns (bool) { require(!instructions.isEmpty(), "Instructions must not be empty"); - require(!operationId.isEmpty(), "Operation ID must not be empty"); + require(!operationId.isEmpty(), "operationId must not be empty"); require(value > 0, "Value must be greater than zero"); FundableData storage newFund = orderedFunds[operationId.toHash()]; diff --git a/test/Fundable.js b/test/Fundable.js index d3e6782..7c6e176 100644 --- a/test/Fundable.js +++ b/test/Fundable.js @@ -52,7 +52,7 @@ contract('Fundable', (accounts) => { FUNDABLE_INSTRUCTION, {from: from} ), - 'Operation ID must not be empty' + 'operationId must not be empty' ); }); @@ -141,7 +141,7 @@ contract('Fundable', (accounts) => { FUNDABLE_INSTRUCTION, {from: authorizedFundOperator} ), - 'Operation ID must not be empty' + 'operationId must not be empty' ); }); @@ -277,7 +277,7 @@ contract('Fundable', (accounts) => { operationId, {from: tokenOperatorAccount} ), - 'Only the wallet who receive the fund can cancel' + 'Only the wallet who receives the fund can cancel' ); }); @@ -464,7 +464,7 @@ contract('Fundable', (accounts) => { randomString.generate(), {from: tokenOperatorAccount} ), - 'Only process if the status is ordered' + ' A fund can only be put in process from status Ordered' ); }); @@ -479,7 +479,7 @@ contract('Fundable', (accounts) => { operationId, {from: tokenOperatorAccount} ), - 'Only process if the status is ordered' + 'A fund can only be put in process from status Ordered' ); }); @@ -663,5 +663,5 @@ contract('Fundable', (accounts) => { }); }); }); - + });