Skip to content

Module Development Task: Volume Restriction (Dumping) #268

@CPSTL

Description

@CPSTL

Module Development Task

Volume Restriction (Dumping)

Module Type Bounty Completion deadline
Transfer Manager Approx. 10, 000 POLY 21 days to complete once task is confirmed by external developer(s).

Short Summary:

This requires a way to track the number of tokens sent in a given time period. This module aims to prevent the dumping ability for security token owners by restricting trading by time period.

Note: This can be implemented as TM module with current architecture.

Bounty Requirements

  1. Module specs are fulfilled
  2. Module is implemented using appropriate module interface
  3. Module is tested with >95% branch coverage
  4. Module is delivered before deadline
  5. Module does not present any bugs.
  6. 21 days to complete module from developers initial start date.

IMPORTANT: Please work from the development-1.5.0 branch instead of master.

Module Specs and Suggested Implementation

The implementation requires keeping count of volume sent from an address in a given time period.

mapping(address => mapping(uint256 => uint256)) volumeTally;
mapping(address => mapping(uint256 => uint256)) volumeLimit;
mapping(address => uint256) limitPeriod;

// Assumes this function is only called when the transfer is successful
function verifyTransfer(address _from, address _to, uint256 _amount, bool _isTransfer) public returns(Result) {
    uint256 periodId = now.div(limitPeriod[_from]);
    if (_amount.add(volumeTally[_from][periodId]) > volumeLimit[_from][periodId]) {
        return false;
    };
    volumeTally[_from][periodId] += _amount;
    return true;
}

Module Details and Specs (Wireframe)

Wireframe Link: https://www.lucidchart.com/invitations/accept/8fcf7c3f-6f84-4846-8e5c-14a7df29a8cc

Metadata

Metadata

Assignees

No one assigned

    Labels

    Module developmentUsed when new module is createdopen-source communitySomething suggest or developed by external developers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions