Intercoin / ReserveTokenContract

Used to power the Intercoin Reserve Token, this token is optimized for stability and growth.
GNU Affero General Public License v3.0
0 stars 1 forks source link

Implement README and additional optional features #2

Open EGreg opened 2 years ago

EGreg commented 2 years ago

Please copy the following into the README and implement it in the smart contract code we will deploy (with address 0x1111...)

IntercoinTokenContract

Intercoin smart contract that issues and manages the tokens to be held on reserve by communities, and act as a bridge currency between them and to other assets on-chain. The approach behind its design is to be radically decentralized and autonomous. Unlike most crypto projects, the initial team and early investors do not sell any pre-minted tokens into the marketplace. Rather, the contract itself mints and sells the tokens, organizes buybacks and manages their transfers according to predetermined rules and parameters which can be easily conveyed to end-users. Proceeds from the sales can be shared with the team and early investors, who may hold other tokens that were used to raise funds for the project. The contract continues to operate into the future, regardless of any activities by any off-chain teams, companies, foundations or organizations.

Holders of the token can be assured of the behavior and operation of the smart contracts on the decentralized network. This goes both for existing decentralized exchanges (such as UniSwap, PancakeSwap, Bancor) as well as the IntercoinTokenContract from which they buy it and to which they sell it.

Collateral in the liquidity pool and buyback fund can be employed to secure the value in a completely decentralized, trustless system rather than a common enterprise, so it would be difficult to classify tokens traded in this manner as a security under either the Howey Test or Risk Capital test. At any rate, the source code of the contracts constitutes full disclosure of how they operate, and what people can expect when buying them. Buyers would only need to look at the parameters that were used when the contract was launched. Take care with the initial parameters when deploying this contract: they should be set depending on your desired tokenomic and regulatory outcomes.

About

:fist: Power to the People

:dollar: Incentives for Long Term Holds, Relationships and Utility

:rocket: Selling Tokens into the Marketplace and Distributing Profits

:whale: Buybacks to Counter Dumping by Whales

:lock: Smart Contract Holds Liquidity: Will Never Rug Pull

:fire: Options for Hyper-Deflation or Rewards for Viral Referrals

:credit_card: Disbursing the proceeds

Overview

Once installed will be use methods:

method name called by description
initialize Anyone initialize a contract
startPool owner starting pool with initial price. can be called only once
_updateRestrictionsAndRules owner set address of TransferRules contract.
bulkTransfer Anyone bulk transfer support
sell Anyone initiate mechanism to smooth out buy and sell prices. Contract will sell some own tokens to LP
buy Anyone initiate mechanism to smooth out buy and sell prices. Contract will buy back some tokens from LP

Settings

TotalSupply are 1_000_000_000 tokens

Methods

initialize

Params:

name type description
name string ERC777 token's name
symbol string ERC777 token's symbol
defaultOperators address[] ERC777 token's defaultOperators
_presalePrice uint256 fixed price(presale Price) to exchange coins to tokens. it's actual before owner call startPool
_predefinedBalances tuple[] array of tuples like [address,amount] of user balances that need to be predefined
_buyTax tuple buy settings - [percentOfTokenAmount, priceDecreaseMin, slippage, percentOfSellPrice]. Default are [0, 10, 10, 0]
_sellTax tuple sell settings - [percentOfTokenAmount, priceIncreaseMin, slippage]. Default are [0, 10, 10]
_transferTax tuple transfer settings - [total, toLiquidity, toBurn]. Default are [0, 10, 0]
_progressiveTax tuple progressive settings - [from, to, duration]. Default are [5, 100, 3600]
_disbursementList tuple[] array of tuples like [address, percent]. sum of percents require to be 100%

startPool

Params:

name type description
price uint256 price mul by 1e9

method initiate first price by adding liquidity. contract eth balance will divide by price to get token amount token's amount and eth will be added to liquidity pool.

updateRestrictionsAndRules

Params:

name type description
rules address TransferRules address contract

TransferRules contract flow validation described here

bulkTransfer

Params:

name type description
_bulkStruct tuple[] array of tuples [recipient, address]
_data bytes data to operatorSend params

sell

mechanism to smooth out buy and sell prices. Contract will sell some own tokens to LP

buy

mechanism to smooth out buy and sell prices. Contract will buyback some tokens from LP

Tuples

BulkStruct

Params:

name type description
recipient address address
amount uint256 amount

BuyTax

Params:

name type description
percentOfTokenAmount uint256 percent of LP token's reserve that need to be buyback by contract
priceDecreaseMin uint256 triggered event ShouldBuy when current sell price will fall by priceDecreaseMin percents of last buyback price
slippage uint256 slippage
percentOfSellPrice uint256 buyback price will update after everytime when contract sell tokens by formula buybackprice = sellprice * percentOfSellPrice / 100

SellTax

Params:

name type description
percentOfTokenAmount uint256 percent of LP token's reserve that need to be sell by contract
priceIncreaseMin uint256 triggered event ShouldSell when current sell price will rise by priceIncreaseMin percents of last LastMaxSellPrice
slippage uint256 slippage

TransferTax

Params:

name type description
total uint256 calculate percent of transfer that applied on each usual transfer(not exchange with Uniswap)
toLiquidity uint256 percent of total that will add to liquidity
toBurn uint256 percent of LP tokens that contract will burn after adding liquidity. can be [0;100]

ProgressiveTax

Params:

name type description
from uint256 percent
to uint256 percent
duration uint256 progressive tax can be applied to user by this duration

DisbursementList

Params:

name type description
addr address address
percent uint256 percent [1;100]

Events

event name description
RulesUpdated when Rules contract updated
SwapAndLiquifyEnabledUpdated when flag SwapAndLiquifyEnabled changed
SwapAndLiquify when SwapAndLiquify happens
SentBonusToInviter when inviter get some bonus
SentDisbursements emitted after all disbursements were sent
PresaleBuy when contract recieve coins and return tokens in presale period
NotEnoughTokenToSell when contract didn't have enough tokens to sell
NotEnoughETHToBuyTokens when contract didn't have enough Coins to buy tokens
NoAvailableReserves when no available LP reserve
NoAvailableReserveToken when no available tokens in LP reserve
NoAvailableReserveETH when no available Coins in LP reserve
ContractSellTokens when contract sell additional tokens to LP successfully
ContractBuyBackTokens when contract buy back tokens from LP successfully
ShouldSell when current sell price become more than lastMaxSellPrice
ShouldBuy when current sell price become less than lastBuyPrice

Example to use

After deploy owner need: