Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Changelog
All notable changes to this project will be documented in this file.

# v2.1.0 - Release Candidate

[__2.1.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __13-089-18__

## Manual Approval TransferManager
* Removed `0x0` check for the `_from` address to `ManualApprovalTransferManager`. This allows for the Issuer/Transfer Agent to approve a one-off mint of tokens that otherwise would not be possible.
* Changed the version of `ManualApprovalTransferManagerFactory` from `1.0.0` to `2.0.1`.

# v1.5.0 - Release Candidate

[__1.5.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __15-08-18__
Expand Down Expand Up @@ -39,13 +47,13 @@ All notable changes to this project will be documented in this file.
* All permissions are denied if no permission manager is active.
* Generalize the STO varaible names and added them in `ISTO.sol` to use the common standard in all STOs.
* Generalize the event when any new token get registered with the polymath ecosystem. `LogNewSecurityToken` should emit _ticker, _name, _securityTokenAddress, _owner, _addedAt, _registrant respectively. #230
* Change the function name of `withdraPoly` to `withdrawERC20` and make the function generalize to extract tokens from the ST contract. parmeters are contract address and the value need to extract from the securityToken.
* Change the function name of `withdraPoly` to `withdrawERC20` and make the function generalize to extract tokens from the ST contract. parmeters are contract address and the value need to extract from the securityToken.

## Removed
* Removed investors list pruning
* Remove `swarmHash` from the `registerTicker(), addCustomTicker(), generateSecurityToken(), addCustomSecurityToken()` functions of TickerRegistry.sol and SecurityTokenRegistry.sol. #230
* Remove `Log` prefix from all the event present in the ecosystem.
* Removed `addTagByModuleType` & `removeTagsByModuleType` from MR.
* Removed `addTagByModuleType` & `removeTagsByModuleType` from MR.

======

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ contract ManualApprovalTransferManager is ITransferManager {
* @param _expiryTime is the time until which the transfer is allowed
*/
function addManualApproval(address _from, address _to, uint256 _allowance, uint256 _expiryTime) public withPerm(TRANSFER_APPROVAL) {
require(_from != address(0), "Invalid from address");
require(_to != address(0), "Invalid to address");
/*solium-disable-next-line security/no-block-members*/
require(_expiryTime > now, "Invalid expiry time");
Expand All @@ -129,7 +128,6 @@ contract ManualApprovalTransferManager is ITransferManager {
* @param _expiryTime is the time until which the transfer is blocked
*/
function addManualBlocking(address _from, address _to, uint256 _expiryTime) public withPerm(TRANSFER_APPROVAL) {
require(_from != address(0), "Invalid from address");
require(_to != address(0), "Invalid to address");
/*solium-disable-next-line security/no-block-members*/
require(_expiryTime > now, "Invalid expiry time");
Expand All @@ -144,7 +142,6 @@ contract ManualApprovalTransferManager is ITransferManager {
* @param _to is the address to which transfers are approved
*/
function revokeManualApproval(address _from, address _to) public withPerm(TRANSFER_APPROVAL) {
require(_from != address(0), "Invalid from address");
require(_to != address(0), "Invalid to address");
delete manualApprovals[_from][_to];
emit RevokeManualApproval(_from, _to, msg.sender);
Expand All @@ -156,7 +153,6 @@ contract ManualApprovalTransferManager is ITransferManager {
* @param _to is the address to which transfers are approved
*/
function revokeManualBlocking(address _from, address _to) public withPerm(TRANSFER_APPROVAL) {
require(_from != address(0), "Invalid from address");
require(_to != address(0), "Invalid to address");
delete manualBlockings[_from][_to];
emit RevokeManualBlocking(_from, _to, msg.sender);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract ManualApprovalTransferManagerFactory is ModuleFactory {
constructor (address _polyAddress, uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public
ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost)
{
version = "1.0.0";
version = "2.0.1";
name = "ManualApprovalTransferManager";
title = "Manual Approval Transfer Manager";
description = "Manage transfers using single approvals / blocking";
Expand Down
49 changes: 20 additions & 29 deletions test/j_manual_approval_transfer_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,18 +321,6 @@ contract("ManualApprovalTransferManager", accounts => {
assert.equal((await I_SecurityToken.balanceOf(account_investor1)).toNumber(), web3.utils.toWei("5", "ether"));
});

it("Should fail to add a manual approval because invalid _from address", async () => {
await catchRevert(
I_ManualApprovalTransferManager.addManualApproval(
"",
account_investor4,
web3.utils.toWei("2", "ether"),
latestTime() + duration.days(1),
{ from: token_owner }
)
);
});

it("Should fail to add a manual approval because invalid _to address", async () => {
await catchRevert(
I_ManualApprovalTransferManager.addManualApproval(
Expand Down Expand Up @@ -367,6 +355,16 @@ contract("ManualApprovalTransferManager", accounts => {
);
});

it("Add a manual approval for a 5th investor from issuance", async () => {
await I_ManualApprovalTransferManager.addManualApproval(
"",
account_investor5,
web3.utils.toWei("2", "ether"),
latestTime() + duration.days(1),
{ from: token_owner }
);
});

it("Should fail to add a manual approval because allowance is laready exists", async () => {
await catchRevert(
I_ManualApprovalTransferManager.addManualApproval(
Expand All @@ -379,10 +377,6 @@ contract("ManualApprovalTransferManager", accounts => {
);
});

it("Should fail to revoke manual approval because invalid _from address", async () => {
await catchRevert(I_ManualApprovalTransferManager.revokeManualApproval("", account_investor4, { from: token_owner }));
});

it("Should fail to revoke manual approval because invalid _to address", async () => {
await catchRevert(I_ManualApprovalTransferManager.revokeManualApproval(account_investor1, "", { from: token_owner }));
});
Expand All @@ -409,6 +403,15 @@ contract("ManualApprovalTransferManager", accounts => {
assert.equal((await I_SecurityToken.balanceOf(account_investor4)).toNumber(), web3.utils.toWei("1", "ether"));
});

it("Approval fails with wrong from to address", async () => {
await catchRevert(I_SecurityToken.transfer(account_investor5, web3.utils.toWei("1", "ether"), { from: account_investor1 }));
});

it("Use 100% of issuance approval", async () => {
await I_SecurityToken.mint(account_investor5, web3.utils.toWei("2", "ether"), { from: token_owner });
assert.equal((await I_SecurityToken.balanceOf(account_investor5)).toNumber(), web3.utils.toWei("2", "ether"));
});

it("Check verifyTransfer without actually transferring", async () => {
let verified = await I_SecurityToken.verifyTransfer.call(
account_investor1,
Expand Down Expand Up @@ -439,14 +442,6 @@ contract("ManualApprovalTransferManager", accounts => {
await I_SecurityToken.transfer(account_investor2, web3.utils.toWei("1", "ether"), { from: account_investor1 });
});

it("Should fail to add a manual block because invalid _from address", async () => {
await catchRevert(
I_ManualApprovalTransferManager.addManualBlocking("", account_investor2, latestTime() + duration.days(1), {
from: token_owner
})
);
});

it("Should fail to add a manual block because invalid _to address", async () => {
await catchRevert(
I_ManualApprovalTransferManager.addManualBlocking(account_investor1, "", latestTime() + duration.days(1), {
Expand Down Expand Up @@ -477,10 +472,6 @@ contract("ManualApprovalTransferManager", accounts => {
await catchRevert(I_SecurityToken.transfer(account_investor2, web3.utils.toWei("1", "ether"), { from: account_investor1 }));
});

it("Should fail to revoke manual block because invalid _from address", async () => {
await catchRevert(I_ManualApprovalTransferManager.revokeManualBlocking("0x0", account_investor2, { from: token_owner }));
});

it("Should fail to revoke manual block because invalid _to address", async () => {
await catchRevert(I_ManualApprovalTransferManager.revokeManualBlocking(account_investor1, "0x0", { from: token_owner }));
});
Expand Down Expand Up @@ -550,7 +541,7 @@ contract("ManualApprovalTransferManager", accounts => {
"Allows an issuer to set manual approvals or blocks for specific pairs of addresses and amounts. Init function takes no parameters.",
"Wrong Module added"
);
assert.equal(await I_ManualApprovalTransferManagerFactory.version.call(), "1.0.0");
assert.equal(await I_ManualApprovalTransferManagerFactory.version.call(), "2.0.1");
});

it("Should get the tags of the factory", async () => {
Expand Down