Skip to content

Instantly share code, notes, and snippets.

@munair
Forked from benjiqq/pc.md
Last active November 9, 2020 02:25
Show Gist options
  • Save munair/43ccee747baf81f93946a439963b0b63 to your computer and use it in GitHub Desktop.
Save munair/43ccee747baf81f93946a439963b0b63 to your computer and use it in GitHub Desktop.
PC standard

Participation Certifcates (PC)

Participation Certificates are project tokens that are not transferrable. They represent receivables for future deliverable assets.

Function

A PC is created exactly once (issuance) and destroyed once (redemption). It is not transferrable.

Purpose

The PC is an illiquid asset. In the early stages of a project, it is not desirable to have a market created for tokens.

Motivation

To avoid adding a pause function to standard ERC20, the cleaner approach is to split the financing and issuance into two stages.

Details

name symbol decimals _issue _redeem

Implementation

uint256 private _totalSupply; mapping (address => uint256) private _balances;

/** @dev Creates `amount` tokens and assigns them to `account`, increasing
    * the total supply.
*/
function _issue(address account, uint256 amount) internal virtual {
    require(account != address(0), "mint to the zero address");

    //_beforeTokenTransfer(address(0), account, amount);

    _totalSupply = _totalSupply.add(amount);
    _balances[account] = _balances[account].add(amount);
    emit Transfer(address(0), account, amount);
}
function _redeem(address account, uint256 amount) internal virtual {
    require(account != address(0), "ERC20: burn from the zero address");

    _beforeTokenTransfer(account, address(0), amount);

    _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
    _totalSupply = _totalSupply.sub(amount);
    emit Transfer(account, address(0), amount);
}
@munair
Copy link
Author

munair commented Nov 9, 2020

Simplify verbiage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment