diff --git a/XIPS/xip-shares.md b/XIPS/xip-shares.md new file mode 100644 index 0000000..0c3ee97 --- /dev/null +++ b/XIPS/xip-shares.md @@ -0,0 +1,102 @@ +<<<<<<< Updated upstream +--- +xip: 2 +title: SHARES Dividend Yielding Token Standard +status: Draft +type: Standard Track +category: XRC +author: R. Quincy Jones | Github:@CoinClubQuincy | quincy@xdc.org +created: 2022-9-25 +--- + +## What is a SHARE? + +The SHARES are built for Apps on the XDC Network that would like an autonomous means of distribution of Fees paid to the contract in the form of dividends to the token holders LIVE as the DApp gains usage.`. +======= +--- +**xip:** +**title:** SHARES - Dividend Yielding Token Standard +**description:** SHARES are a NFT token standard that provides a means for fees paid to the contract to become split among the token holders +**author:** R. Quincy Jones | Github:@CoinClubQuincy | quincy@xdc.org +**discussions-to:** +**status:** Draft +**type:** Standards Track +**category:** XRC +**created:** (2022-9-25) +**requires :** none +--- + +The standard provide here is built for Apps on the XDC Network that would like an autonomous means of distribution of Fees paid to the contract in the form of dividends to the token holders LIVE as the DApp gains usage.`. +>>>>>>> Stashed changes + +## Abstract +The SHARE token is a decentralized share of ownership over a DApp and the profits generated by the DApp. The SHARE tokens are NFTs that can also be used within the DApp for governance and control over functions in the DApp. +SHARES act as a new means for Apps,Startups,and Businesses to have an automated means to distribute XDC generated by their applications on the XDC Network. +## Motivation +This standard allows for a new Market of autonomous Apps on XDC where applications can act entirely autonomous as the grow and allow for interested parties be able to own the DApps. currently Apps either direct funds to a founder contract or have a currency created with its own fees and incentives. The Idea with SHARES is a developer can create the app they want, accept fees and direct the fees to the SHARES while being able to sell parts of their app as it grows to help fund the further developements of additional contracts that contribute to the original SHARES or sell applications they have that get steady use. Globally developers can create DApps and sell them as they grow as well as redeem the yields generated by the contract. + +## Specification + +**Token Variables** +MUST - Developers must Name the DApp accordingly and define how many SHARES are created + +- name: Name is required for naming DApp +- symbol: Symbol is a short hand 3-5 character code to reference DApp Nnme. +- totalSupply: total supply MAX is 1000 tokens +```` +string public name; +string public symbol; +uint public totalSupply; +```` + + +**View_Account** +OPTIONAL - view tokens yield in contract + + function View_Account(uint _token)public view returns(uint); + +**Redeem** +In order to again dividends user MUST select the Redeem function + + function Redeem()public returns(bool); + + + +****All other function of inherited from the XRC1155 contract standard*** + + + +## Rationale +this contract act as a amendment to the XRC1155 token standard to create a new type of token that acts as ownerships of different DApps this new type of token allows for DApps to be own and traded to allow for developers to sell their blockchain products as the perform no mater the function of how big or small they are. + +## Backwards Compatibility +All XIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The XIP must explain how the author proposes to deal with these incompatibilities. XIP submissions without a sufficient backwards compatibility treatise may be rejected outright. + + +## Reference Implementation +Github:https://github.com/CoinClubQuincy/XRC-SHARES + +All function within contract can use this line of code at the bottom of their function to forward funds to the **receive()** function to allocate funds. +````solidity + address(this).call{value: msg.value}; +```` +This contract bellow is an example of a lemonade stand contract that receives 100XDC for a glass of lemonade and divides those funds amongst 10 token holders + +````solidity +contract lemonadeStand is XRC100{ + constructor(string memory _name,string memory _symbol,uint _totalSupply) XRC100(_name,_symbol,_totalSupply){} + + function GlassOfLemonade() public payable returns(bool){ + require(msg.value == 100000000000000000000,"need more funds"); + + //this call can be used in all functions that recive fees + address(this).call{value: msg.value}; //use this to forward all funds to the receive function + return true; + } +} +```` +## Security Considerations +**WARNING: Lost SHARES will result in the portion of funds allocated to the token to also be lost** + +## Copyright +Copyright and related rights waived via [CC0](../LICENSE.md).