diff --git a/contracts/schemes/Auction4Reputation.sol b/contracts/schemes/Auction4Reputation.sol index bc1d779a..b2ca1c46 100644 --- a/contracts/schemes/Auction4Reputation.sol +++ b/contracts/schemes/Auction4Reputation.sol @@ -104,7 +104,7 @@ contract Auction4Reputation is Ownable { reputationRewardLeft = reputationRewardLeft.sub(reputation); require( ControllerInterface(avatar.owner()) - .mintReputation(reputation, _beneficiary, address(avatar)), "mint reputation should success"); + .mintReputation(reputation, _beneficiary, address(avatar)), "mint reputation should succeed"); emit Redeem(_auctionId, _beneficiary, reputation); } @@ -119,7 +119,7 @@ contract Auction4Reputation is Ownable { require(now <= auctionsEndTime, "bidding should be within the allowed bidding period"); // solhint-disable-next-line not-rely-on-time require(now >= auctionsStartTime, "bidding is enable only after bidding auctionsStartTime"); - require(token.transferFrom(msg.sender, address(this), _amount), "transferFrom should success"); + require(token.transferFrom(msg.sender, address(this), _amount), "transferFrom should succeed"); // solhint-disable-next-line not-rely-on-time auctionId = (now - auctionsStartTime) / auctionPeriod; Auction storage auction = auctions[auctionId]; @@ -146,7 +146,7 @@ contract Auction4Reputation is Ownable { // solhint-disable-next-line not-rely-on-time require(now > auctionsEndTime, "now > auctionsEndTime"); uint256 tokenBalance = token.balanceOf(address(this)); - require(token.transfer(wallet, tokenBalance), "transfer should success"); + require(token.transfer(wallet, tokenBalance), "transfer should succeed"); } } diff --git a/contracts/schemes/ExternalLocking4Reputation.sol b/contracts/schemes/ExternalLocking4Reputation.sol index 982681fd..4b375e04 100644 --- a/contracts/schemes/ExternalLocking4Reputation.sol +++ b/contracts/schemes/ExternalLocking4Reputation.sol @@ -77,7 +77,7 @@ contract ExternalLocking4Reputation is Locking4Reputation, Ownable { (bool result, bytes memory returnValue) = // solhint-disable-next-line avoid-call-value,avoid-low-level-calls externalLockingContract.call(abi.encodeWithSignature(getBalanceFuncSignature, beneficiary)); - require(result, "call to external contract should success"); + require(result, "call to external contract should succeed"); uint256 lockedAmount; // solhint-disable-next-line no-inline-assembly assembly { diff --git a/contracts/schemes/Locking4Reputation.sol b/contracts/schemes/Locking4Reputation.sol index 15834d94..c3578aa9 100644 --- a/contracts/schemes/Locking4Reputation.sol +++ b/contracts/schemes/Locking4Reputation.sol @@ -59,7 +59,7 @@ contract Locking4Reputation { require( ControllerInterface( avatar.owner()) - .mintReputation(reputation, _beneficiary, address(avatar)), "mint reputation should success"); + .mintReputation(reputation, _beneficiary, address(avatar)), "mint reputation should succeed"); emit Redeem(_beneficiary, reputation); } diff --git a/contracts/schemes/LockingToken4Reputation.sol b/contracts/schemes/LockingToken4Reputation.sol index d492193f..606ba2cc 100644 --- a/contracts/schemes/LockingToken4Reputation.sol +++ b/contracts/schemes/LockingToken4Reputation.sol @@ -61,7 +61,7 @@ contract LockingToken4Reputation is Locking4Reputation, Ownable { */ function release(address _beneficiary, bytes32 _lockingId) public returns(bool) { uint256 amount = super._release(_beneficiary, _lockingId); - require(lockedTokens[_lockingId].transfer(_beneficiary, amount), "transfer should success"); + require(lockedTokens[_lockingId].transfer(_beneficiary, amount), "transfer should succeed"); return true; } @@ -83,7 +83,7 @@ contract LockingToken4Reputation is Locking4Reputation, Ownable { require(numerator > 0, "numerator should be > 0"); require(denominator > 0, "denominator should be > 0"); - require(_token.transferFrom(msg.sender, address(this), _amount), "transferFrom should success"); + require(_token.transferFrom(msg.sender, address(this), _amount), "transferFrom should succeed"); lockingId = super._lock(_amount, _period, msg.sender, numerator, denominator); diff --git a/contracts/universalSchemes/ContributionReward.sol b/contracts/universalSchemes/ContributionReward.sol index d581419f..fbb89ea4 100644 --- a/contracts/universalSchemes/ContributionReward.sol +++ b/contracts/universalSchemes/ContributionReward.sol @@ -19,7 +19,7 @@ contract ContributionReward is UniversalScheme, VotingMachineCallbacks, Proposal address indexed _avatar, bytes32 indexed _proposalId, address indexed _intVoteInterface, - bytes32 _contributionDescription, + string _contributionDescription, int256 _reputationChange, uint[5] _rewards, ERC20 _externalToken, @@ -150,7 +150,7 @@ contract ContributionReward is UniversalScheme, VotingMachineCallbacks, Proposal */ function proposeContributionReward( Avatar _avatar, - bytes32 _contributionDescriptionHash, + string memory _contributionDescriptionHash, int256 _reputationChange, uint[5] memory _rewards, ERC20 _externalToken, diff --git a/contracts/universalSchemes/GenericScheme.sol b/contracts/universalSchemes/GenericScheme.sol index 78440bb4..5db01f8b 100644 --- a/contracts/universalSchemes/GenericScheme.sol +++ b/contracts/universalSchemes/GenericScheme.sol @@ -16,7 +16,7 @@ contract GenericScheme is UniversalScheme, VotingMachineCallbacks, ProposalExecu address indexed _avatar, bytes32 indexed _proposalId, bytes _callData, - bytes32 _descriptionHash + string _descriptionHash ); event ProposalExecuted( @@ -145,7 +145,7 @@ contract GenericScheme is UniversalScheme, VotingMachineCallbacks, ProposalExecu * @param _descriptionHash proposal description hash * @return an id which represents the proposal */ - function proposeCall(Avatar _avatar, bytes memory _callData, bytes32 _descriptionHash) + function proposeCall(Avatar _avatar, bytes memory _callData, string memory _descriptionHash) public returns(bytes32) { diff --git a/contracts/universalSchemes/GlobalConstraintRegistrar.sol b/contracts/universalSchemes/GlobalConstraintRegistrar.sol index 65941103..d6180b66 100644 --- a/contracts/universalSchemes/GlobalConstraintRegistrar.sol +++ b/contracts/universalSchemes/GlobalConstraintRegistrar.sol @@ -19,7 +19,7 @@ contract GlobalConstraintRegistrar is UniversalScheme, VotingMachineCallbacks, P address _gc, bytes32 _params, bytes32 _voteToRemoveParams, - bytes32 _descriptionHash + string _descriptionHash ); event RemoveGlobalConstraintsProposal( @@ -27,7 +27,7 @@ contract GlobalConstraintRegistrar is UniversalScheme, VotingMachineCallbacks, P bytes32 indexed _proposalId, address indexed _intVoteInterface, address _gc, - bytes32 _descriptionHash + string _descriptionHash ); event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param); @@ -135,7 +135,7 @@ contract GlobalConstraintRegistrar is UniversalScheme, VotingMachineCallbacks, P address _gc, bytes32 _params, bytes32 _voteToRemoveParams, - bytes32 _descriptionHash) + string memory _descriptionHash) public returns(bytes32) { @@ -176,7 +176,7 @@ contract GlobalConstraintRegistrar is UniversalScheme, VotingMachineCallbacks, P * @param _descriptionHash proposal's description hash * @return bytes32 -the proposal id */ - function proposeToRemoveGC(Avatar _avatar, address _gc, bytes32 _descriptionHash) public returns(bytes32) { + function proposeToRemoveGC(Avatar _avatar, address _gc, string memory _descriptionHash) public returns(bytes32) { Controller controller = Controller(_avatar.owner()); require(controller.isGlobalConstraintRegistered(_gc, address(_avatar))); Parameters memory params = parameters[getParametersFromController(_avatar)]; diff --git a/contracts/universalSchemes/SchemeRegistrar.sol b/contracts/universalSchemes/SchemeRegistrar.sol index acd3ecf0..7a0acfc2 100644 --- a/contracts/universalSchemes/SchemeRegistrar.sol +++ b/contracts/universalSchemes/SchemeRegistrar.sol @@ -19,14 +19,14 @@ contract SchemeRegistrar is UniversalScheme, VotingMachineCallbacks, ProposalExe address _scheme, bytes32 _parametersHash, bytes4 _permissions, - bytes32 _descriptionHash + string _descriptionHash ); event RemoveSchemeProposal(address indexed _avatar, bytes32 indexed _proposalId, address indexed _intVoteInterface, address _scheme, - bytes32 _descriptionHash + string _descriptionHash ); event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param); @@ -126,7 +126,7 @@ contract SchemeRegistrar is UniversalScheme, VotingMachineCallbacks, ProposalExe address _scheme, bytes32 _parametersHash, bytes4 _permissions, - bytes32 _descriptionHash + string memory _descriptionHash ) public returns(bytes32) @@ -172,7 +172,7 @@ contract SchemeRegistrar is UniversalScheme, VotingMachineCallbacks, ProposalExe * @param _descriptionHash proposal description hash * NB: not only registers the proposal, but also votes for it */ - function proposeToRemoveScheme(Avatar _avatar, address _scheme, bytes32 _descriptionHash) + function proposeToRemoveScheme(Avatar _avatar, address _scheme, string memory _descriptionHash) public returns(bytes32) { diff --git a/contracts/universalSchemes/UpgradeScheme.sol b/contracts/universalSchemes/UpgradeScheme.sol index 2bd5ec8e..d5bc9e92 100644 --- a/contracts/universalSchemes/UpgradeScheme.sol +++ b/contracts/universalSchemes/UpgradeScheme.sol @@ -18,7 +18,7 @@ contract UpgradeScheme is UniversalScheme, VotingMachineCallbacks, ProposalExecu bytes32 indexed _proposalId, address indexed _intVoteInterface, address _newController, - bytes32 _descriptionHash + string _descriptionHash ); event ChangeUpgradeSchemeProposal( @@ -27,7 +27,7 @@ contract UpgradeScheme is UniversalScheme, VotingMachineCallbacks, ProposalExecu address indexed _intVoteInterface, address _newUpgradeScheme, bytes32 _params, - bytes32 _descriptionHash + string _descriptionHash ); event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param); @@ -119,7 +119,7 @@ contract UpgradeScheme is UniversalScheme, VotingMachineCallbacks, ProposalExecu * @param _descriptionHash proposal description hash * @return an id which represents the proposal */ - function proposeUpgrade(Avatar _avatar, address _newController, bytes32 _descriptionHash) + function proposeUpgrade(Avatar _avatar, address _newController, string memory _descriptionHash) public returns(bytes32) { @@ -158,7 +158,7 @@ contract UpgradeScheme is UniversalScheme, VotingMachineCallbacks, ProposalExecu Avatar _avatar, address _scheme, bytes32 _params, - bytes32 _descriptionHash + string memory _descriptionHash ) public returns(bytes32) diff --git a/contracts/universalSchemes/VestingScheme.sol b/contracts/universalSchemes/VestingScheme.sol index c3785293..919ba232 100644 --- a/contracts/universalSchemes/VestingScheme.sol +++ b/contracts/universalSchemes/VestingScheme.sol @@ -16,7 +16,7 @@ contract VestingScheme is UniversalScheme, VotingMachineCallbacks, ProposalExecu event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param); event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId); - event AgreementProposal(address indexed _avatar, bytes32 indexed _proposalId, bytes32 _descriptionHash); + event AgreementProposal(address indexed _avatar, bytes32 indexed _proposalId, string _descriptionHash); event NewVestedAgreement(uint256 indexed _agreementId); event ProposedVestedAgreement(uint256 indexed _agreementId, bytes32 indexed _proposalId); event SignToCancelAgreement(uint256 indexed _agreementId, address indexed _signer); @@ -123,7 +123,7 @@ contract VestingScheme is UniversalScheme, VotingMachineCallbacks, ProposalExecu uint256 _signaturesReqToCancel, address[] calldata _signersArray, Avatar _avatar, - bytes32 _descriptionHash + string calldata _descriptionHash ) external returns(bytes32) diff --git a/contracts/universalSchemes/VoteInOrganizationScheme.sol b/contracts/universalSchemes/VoteInOrganizationScheme.sol index e5c52342..363db61d 100644 --- a/contracts/universalSchemes/VoteInOrganizationScheme.sol +++ b/contracts/universalSchemes/VoteInOrganizationScheme.sol @@ -18,7 +18,7 @@ contract VoteInOrganizationScheme is UniversalScheme, VotingMachineCallbacks, Pr IntVoteInterface _originalIntVote, bytes32 _originalProposalId, uint256 _vote, - bytes32 _descriptionHash + string _descriptionHash ); event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param, bytes _callReturnValue); @@ -123,7 +123,7 @@ contract VoteInOrganizationScheme is UniversalScheme, VotingMachineCallbacks, Pr IntVoteInterface _originalIntVote, bytes32 _originalProposalId, uint256 _vote, - bytes32 _descriptionHash) + string memory _descriptionHash) public returns(bytes32) { diff --git a/test/contributionreward.js b/test/contributionreward.js index 54cfe058..e221e6e7 100644 --- a/test/contributionreward.js +++ b/test/contributionreward.js @@ -111,7 +111,7 @@ contract('ContributionReward', accounts => { var testSetup = await setup(accounts,0); var periodLength = 1; var tx = await testSetup.contributionReward.proposeContributionReward(testSetup.org.avatar.address, - web3.utils.asciiToHex("description"), + "description-hash", 10, [1,2,3,periodLength,5], testSetup.standardTokenMock.address, @@ -120,7 +120,7 @@ contract('ContributionReward', accounts => { assert.equal(tx.logs[0].event, "NewContributionProposal"); assert.equal(await helpers.getValueFromLogs(tx, '_avatar',0), testSetup.org.avatar.address, "Wrong log: _avatar"); assert.equal(await helpers.getValueFromLogs(tx, '_intVoteInterface',0), testSetup.contributionRewardParams.votingMachine.absoluteVote.address, "Wrong log: _intVoteInterface"); - assert.equal(await helpers.getValueFromLogs(tx, '_contributionDescription',10), web3.utils.padRight(web3.utils.asciiToHex("description"),64), "Wrong log: _contributionDescription"); + assert.equal(await helpers.getValueFromLogs(tx, '_contributionDescription',15), "description-hash", "Wrong log: _contributionDescription"); assert.equal(await helpers.getValueFromLogs(tx, '_reputationChange',0), 10, "Wrong log: _reputationChange"); var arr = await helpers.getValueFromLogs(tx, '_rewards',0); assert.equal(arr[0].words[0], 1, "Wrong log: _rewards"); diff --git a/test/controller.js b/test/controller.js index f3ff3918..402e9781 100644 --- a/test/controller.js +++ b/test/controller.js @@ -189,7 +189,7 @@ contract('Controller', accounts => { helpers.assertVMException(ex); } }else{ - //unregister should success + //unregister should succeed tx = await controller.unregisterScheme(unregisteredScheme,avatar.address,{ from: registeredScheme }); assert.equal(tx.logs.length, 1); assert.equal(tx.logs[0].event, "UnregisterScheme"); diff --git a/test/ucontroller.js b/test/ucontroller.js index af4caead..514e136c 100644 --- a/test/ucontroller.js +++ b/test/ucontroller.js @@ -212,7 +212,7 @@ contract('UController',accounts => { helpers.assertVMException(ex); } }else{ - //unregister should success + //unregister should succeed tx = await controller.unregisterScheme(unregisteredScheme,avatar.address,{ from: registeredScheme }); assert.equal(tx.logs.length, 1); assert.equal(tx.logs[0].event, "UnregisterScheme");