Bitcoin Forum
June 29, 2024, 11:47:09 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: [ANN] "Ten Times" (TENT) token sale  (Read 249 times)
marilyn4325 (OP)
Full Member
***
Offline Offline

Activity: 229
Merit: 134



View Profile
January 31, 2018, 09:27:08 PM
 #1



"Ten Times" (symbol TENT) is a new standard ERC20 token on the Ethereum network, with a special feature: each block your balance gets increased by about 0.000115 %. This means in one year, after about 2 millions blocks (about 16 seconds block time at the moment), because of compound interest, your balance gets increased 10 times! (1.00000115 ^ 2,000,000 = 10) In half a year it is still about 3 times. This is the perfect coin to park some of your money. You can watch an example address how it grows about each 16 seconds for each new block, to which I just sent 10 TENT:

https://etherscan.io/token/0xefd57b75cad5ac36ba102a88e34374a7bb68acf3?a=0x144e9bbf3dbc6ec9d3a84844d54416e80ac6fb7c

I sell 90% of the 1 million supply of the token for the next 40,000 blocks (about 7 days) at EtherDelta, see here:

https://etherdelta.com/#0xefd57b75cad5ac36ba102a88e34374a7bb68acf3-ETH

And it costs only 0.0001 ETH per TENT!

You can use EtherDelta e.g. in combination with MetaMask. Just deploy some Ethers, buy your TENTs, and then withdraw the TENTs to your MetaMask wallet. Note: you need some patience with EtherDelta, deploying etc. can need some minutes depending on the network speed.

10% will be used, if you can't buy with EtherDelta and want to buy it from me direct, or want to buy it from me with Bitcoin. When the sell order expires, I will burn all remaining coins of the 90%. The 10% is for me to make some TENT coins for myself.

To use the coin, you need a Ethereum wallet that supports ERC20 coins. For example for https://www.myetherwallet.com , you have to add the token first. It doesn't recognize automatically the symbol and number of decimals, so you have to enter it manually. These are the parameters:

Token Contract Address: 0xefd57b75cad5ac36ba102a88e34374a7bb68acf3
Token Symbol: TENT
Decimals: 10


It looks like this:



MyEtherWallet works good in combination with MetaMask as well. For MetaMask you have to specify just the contract address with "Add Token", it figures out the name and decimals on its own. For other wallets, see e.g. the manual for the Crypterium token:

https://medium.com/@crypterium_io/crypterium-manual-how-to-use-use-tokens-in-wallet-42d7f5c1d9f3

Just replace the CRPT contract address with the TENT contract address, use "TENT" as the Token Symbol, and 10 for the number of decimals. Don't worry that tokens get lost if you do something wrong, as long as you own your Ethereum address, the tokens are associated to your address, independently if you add the token address first to your wallet or not. You can always verify it on Etherscan and if your wallet doesn't support ERC20 tokens, you can import your private keys to another wallet and then enable the token for it.

Important: Don't use an Ethereum address of an exchange like Poloniex or Bittrex to send your ERC20 tokens to, the tokens are lost then!

Unlike an ICO, this coin already works and you can use it to get more money, in case the exchange rate stays the same or doesn't drop too much. Might even get listed later on a bigger exchange as well, if there is some interest in it, but it will be always possible to trade it at EtherDelta and other peer-to-peer exchanges.

Disclaimer: I've tested the token extensively on the test net and on the main net, but I can't be sure that it is bug free. And unlike the DAO decable, it is unlikely that the Ethereum blockchain will be hard forked if an error is found in the contract. The source code is the ultimate description of what the token does. It is verified, you can read it here:

https://etherscan.io/address/0xefd57b75cad5ac36ba102a88e34374a7bb68acf3#code

But the contract is much simpler than DAO, so it might work as promised and without any major bugs Grin


Technical details how it works

Whenever some tokens are transferred to or from an address, the current block time is recorded and the interest rate is added, which is calculated by the difference between the last block time and the current block time, and then using an optimized function, which approximates the exponentiation required to calculate the compound interest rate. The runtime, and thus the gas cost, is independent of the exponent (number of blocks), see the source code for the details. The interest rate is also added to the totalSupply value, so that this gives a good approximation of the current totalSupply, without expensive calculations over all balances, and without major rounding problems, which might be the case if I would have used a fixed starting block number and block count just for the totalSupply.

The balanceOf function uses the compound interest calculation as well, so that you get always the current balance, but without the need for an expensive gas operation to actually update the
amount each block (lazy evaluation).

Using only 10 decimals and the uint256 numbers guarantees, that it doesn't overflow in a few years. I think it should last for at least 67 years (2^256 = 1.1579*10^77, so 77 digits altogether, which means for 10 decimals there are 67 digits left, which is 10^67 after 67 years).
marilyn4325 (OP)
Full Member
***
Offline Offline

Activity: 229
Merit: 134



View Profile
January 31, 2018, 10:23:19 PM
 #2

PS: I need a 28 x 28 pixel PNG icon for the token. If someone can draw this for me, and if it looks nice, I'll send you 200 TENT (worth $20).
SmaCo
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile WWW
January 31, 2018, 10:45:25 PM
 #3

Hi marilyn,
will the total value not decrease over time, with every automated issuance? (inflation)...

Second question: there is no burning implemented in the source code - you plan to do it manually via the transfer function?

Best!
SmaCo
IGCGamers
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
January 31, 2018, 11:13:34 PM
 #4

So you pay the interest from the balance 10 percent? If yes, once that 10 percent is exhausted, the token holder will not get any interest? Am i right? What is the benefit for this token buyers. If the token is listed on a good exchange the if the price increases, they can sell the token and en cash it. But if the token doesn't have any value, who will be bothered to hold your tokens even if you pay compounded interest.

If your token is providing interest it would be considered as security and not as utility. Most of the exchanges will not list a token/coin which is a security.

Please clarify
marilyn4325 (OP)
Full Member
***
Offline Offline

Activity: 229
Merit: 134



View Profile
January 31, 2018, 11:33:26 PM
 #5

will the total value not decrease over time, with every automated issuance? (inflation)...

Second question: there is no burning implemented in the source code - you plan to do it manually via the transfer function?


Yes, the total value will decrease, but if you hold the token, you will get as much interest as the value decreases, assuming equal supply and demand. But I hope demand will get higher with time, because people might see that price drops and that it is a good time to buy some tokens. It works for other tokens like CLAM with staking, but with less inflation. It is a bit of an experiment, if this high inflation is good for a coin, but your personal balance will always increase as much as the coin inflates.

And right, I couldn't be bothered to implement the burning in the contract code, I will burn it manually. You can trust me, see my trust ratings. It would be bad for the token and bad for me anyway if I wouldn't fulfill the promise. I will post the burn transaction at the end, sending it to some a burn address like 0x000000000000000000000000000000000000dEaD.
marilyn4325 (OP)
Full Member
***
Offline Offline

Activity: 229
Merit: 134



View Profile
January 31, 2018, 11:44:44 PM
 #6

So you pay the interest from the balance 10 percent? If yes, once that 10 percent is exhausted, the token holder will not get any interest?

No, the interest is paid automatically by the contract code. Tokens are generated virtually each block, so total available supply after one year is about 10 million tokens, minus the burnt tokens, distributed over all balances.

Quote
But if the token doesn't have any value, who will be bothered to hold your tokens even if you pay compounded interest.

That's always the chicken-and-egg problem: If nobody buys the token initially, then it has no value. But if people think it might be useful to have a token with built-in interest, then it might get some value.

Quote
If your token is providing interest it would be considered as security and not as utility. Most of the exchanges will not list a token/coin which is a security.

Thanks, that's interesting, I didn't know the difference between utility and security. But why do exchanges then list coins like CLAM, which is listed on Poloniex and Bittrex? It has a built-in staking mechanism, similar to interest: The more CLAMs you have, the more CLAMs you can get by staking them (proof-of-stake instead of proof-of-work). E.g. WAVES has the same PoS concept, so kind of interest, and it is listed at Bittrex.
IGCGamers
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
February 01, 2018, 12:07:32 AM
 #7

So you pay the interest from the balance 10 percent? If yes, once that 10 percent is exhausted, the token holder will not get any interest?

No, the interest is paid automatically by the contract code. Tokens are generated virtually each block, so total available supply after one year is about 10 million tokens, minus the burnt tokens, distributed over all balances.

Quote
But if the token doesn't have any value, who will be bothered to hold your tokens even if you pay compounded interest.

That's always the chicken-and-egg problem: If nobody buys the token initially, then it has no value. But if people think it might be useful to have a token with built-in interest, then it might get some value.

Quote
If your token is providing interest it would be considered as security and not as utility. Most of the exchanges will not list a token/coin which is a security.

Thanks, that's interesting, I didn't know the difference between utility and security. But why do exchanges then list coins like CLAM, which is listed on Poloniex and Bittrex? It has a built-in staking mechanism, similar to interest: The more CLAMs you have, the more CLAMs you can get by staking them (proof-of-stake instead of proof-of-work). E.g. WAVES has the same PoS concept, so kind of interest, and it is listed at Bittrex.

Thanks for your reply. On what case the tokens are burnt? Please give more details about the burning of tokens. I had plans to start an own coin and i contact many exchanges including poloniex. Every one replied with the template saying "coins/tokens that are considered as security will not be listed". Any coin that assures interest to hold is considered as security. Even though this is the concept of proof of stake, these kind of coins/tokens are not accepted by many exchanges. 

On what idea you launched this token?  You have plans to list on which exchanges?
marilyn4325 (OP)
Full Member
***
Offline Offline

Activity: 229
Merit: 134



View Profile
February 01, 2018, 12:28:40 AM
 #8

On what case the tokens are burnt? Please give more details about the burning of tokens.

Currently I own nearly all tokens. 90% are offered for sale on EtherDelta (you can buy a fraction of the offered tokens as well)

https://etherdelta.com/#0xefd57b75cad5ac36ba102a88e34374a7bb68acf3-ETH

The sale order expires in 7 days. I will then burn all unsold tokens of these 90%.

Quote
I had plans to start an own coin and i contact many exchanges including poloniex. Every one replied with the template saying "coins/tokens that are considered as security will not be listed". Any coin that assures interest to hold is considered as security. Even though this is the concept of proof of stake, these kind of coins/tokens are not accepted by many exchanges. 

On what idea you launched this token?  You have plans to list on which exchanges?

Well, that's strange, because technically CLAM and WAVES are then security, and both are listed at Bittrex. Maybe there is a limit? The stake profit is not very high, compared to the 10x increase per year of my token.

So far I didn't contact any exchange, but would be nice if it gets listed on a bigger exchange than EtherDelta. But I guess they wouldn't be interested, if nearly nobody except me has the token.
IGCGamers
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
February 01, 2018, 01:02:46 AM
 #9

On what case the tokens are burnt? Please give more details about the burning of tokens.

Currently I own nearly all tokens. 90% are offered for sale on EtherDelta (you can buy a fraction of the offered tokens as well)

https://etherdelta.com/#0xefd57b75cad5ac36ba102a88e34374a7bb68acf3-ETH

The sale order expires in 7 days. I will then burn all unsold tokens of these 90%.

Quote
I had plans to start an own coin and i contact many exchanges including poloniex. Every one replied with the template saying "coins/tokens that are considered as security will not be listed". Any coin that assures interest to hold is considered as security. Even though this is the concept of proof of stake, these kind of coins/tokens are not accepted by many exchanges. 

On what idea you launched this token?  You have plans to list on which exchanges?

Well, that's strange, because technically CLAM and WAVES are then security, and both are listed at Bittrex. Maybe there is a limit? The stake profit is not very high, compared to the 10x increase per year of my token.

So far I didn't contact any exchange, but would be nice if it gets listed on a bigger exchange than EtherDelta. But I guess they wouldn't be interested, if nearly nobody except me has the token.

Thanks for your detailed explanation. Do you think people will buy the tokens from etherdelta?  Why can't you sell directly as an ICO? So all the unsold tokens will be burned after 7 days? If yes, even the 10 percent you hold will be burnt or it will be intact?  What exchanges you have on mind to list the tokens apart from etherdelta? I don't know how CLAM and WAVES are listed. May be they implemented this policy recently. 

I have another question.  Assume i have 100 tokens on my wallet and i am getting interest for 100 tokens.  After few days or months, if i sell 50 tokens, my balance will be only 50. On such case, i get the interest for 50 tokens or the initial 100 tokens?  If i sell the tokens, the recipient also gets the interest?

How long the interest will be paid?  Is there any cap for that? Is it life time?

You say that it gets multiplied by 10x. So if some one holds one token, after 12 months, he will have 10 tokens in his wallet?
gold969
Sr. Member
****
Offline Offline

Activity: 1330
Merit: 251


View Profile
February 01, 2018, 02:40:57 AM
 #10





https://twitter.com/Bill_Djons/status/958892717236523008
your tweet, if there is a desire to thank the addresses you will always find on my page on Twitter ... by the way ... Facebook and Instagram have banned advertising crypto and ICO ...
marilyn4325 (OP)
Full Member
***
Offline Offline

Activity: 229
Merit: 134



View Profile
February 01, 2018, 05:02:44 AM
 #11

Thanks for your detailed explanation. Do you think people will buy the tokens from etherdelta?  Why can't you sell directly as an ICO? So all the unsold tokens will be burned after 7 days? If yes, even the 10 percent you hold will be burnt or it will be intact?  What exchanges you have on mind to list the tokens apart from etherdelta? I don't know how CLAM and WAVES are listed. May be they implemented this policy recently. 

I think exchanges like etherdelta are the future, because it is all smart contract based on the Ethereum network, so in theory more safe than conventional exchanges. But I will ask other exchanges as well.

Quote
I have another question.  Assume i have 100 tokens on my wallet and i am getting interest for 100 tokens.  After few days or months, if i sell 50 tokens, my balance will be only 50. On such case, i get the interest for 50 tokens or the initial 100 tokens?  If i sell the tokens, the recipient also gets the interest?

How long the interest will be paid?  Is there any cap for that? Is it life time?

You say that it gets multiplied by 10x. So if some one holds one token, after 12 months, he will have 10 tokens in his wallet?

Each block on the Ethereum network (so about each 16 seconds), 0.000115 % will get added. See this wallet, to which I transferred 10 TENT yesterday:

https://etherscan.io/token/0xefd57b75cad5ac36ba102a88e34374a7bb68acf3?a=0x144e9bbf3dbc6ec9d3a84844d54416e80ac6fb7c

Do a reload each 16 seconds, and you will see that it increases. Until the end of the year it has increased 2 million times, which is 10x (=1.00000115 ^ 2,000,000). But you can always sell and transfer it to another wallet earlier, with all the compound interest that it has so far. Compared to classical bank account, think of it as an interest period of 16 seconds instead of 1 year.

For your example, if you buy 100 tokens today, you will have about 1.00000115 ^ 500,000 * 100 TENTs = 2.117 * 100 TENTs = 211.7 TENT after 3 months in your balance. If you then sell 50 TENTs, the recipient will have 50 TENTs and you will have 161.7 TENTs.
marilyn4325 (OP)
Full Member
***
Offline Offline

Activity: 229
Merit: 134



View Profile
February 01, 2018, 05:03:13 AM
 #12





https://twitter.com/Bill_Djons/status/958892717236523008
your tweet, if there is a desire to thank the addresses you will always find on my page on Twitter ... by the way ... Facebook and Instagram have banned advertising crypto and ICO ...

Nice, thanks!
marilyn4325 (OP)
Full Member
***
Offline Offline

Activity: 229
Merit: 134



View Profile
February 01, 2018, 10:58:18 AM
 #13

For your example, if you buy 100 tokens today, you will have about 1.00000115 ^ 500,000 * 100 TENTs = 2.117 * 100 TENTs = 211.7 TENT after 3 months in your balance.

BTW, for an exact calculation you can use the contract functions:

https://etherscan.io/token/0xefd57b75cad5ac36ba102a88e34374a7bb68acf3?a=0x144e9bbf3dbc6ec9d3a84844d54416e80ac6fb7c#readContract

and click Query on the "facExp" function. The parameters:

k=TENT*10000000000, so e.g. 1000000000000 for this example
q=867598 (always the same value, this is the exponent, expressed as an inverse value)
n=number of blocks, so 500000 for this example
p=8 (always the same value, this is the calculation precision)

The result is 1779448097771. This is just the interest, in smallest TENT units. So it is 177.94. Add this to 100 and you get 277.94, even more than calculated. Try it with 2 million blocks, and you get 1000 for the interest, to which 100 will be added. So I guess I should have named it "Eleven Times" Grin

It even works for very small values. For example if you have just 10 TENT units, that's 0.000000001 TENT, you still get 0.0000000107 TENT at the end of the year, because the calculation is done with the number of blocks as an exponent parameter, not individually by adding the individual interests. And of course it works for 10k TENT or more, too.

And this is good, because if not many people buy it and I burn most of the 90% of the supply as I will do as promised, I can still use my 10% and try to list it at bigger and more classical exchanges.
IGCGamers
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
February 02, 2018, 01:44:14 AM
 #14

On what case the tokens are burnt? Please give more details about the burning of tokens.

Currently I own nearly all tokens. 90% are offered for sale on EtherDelta (you can buy a fraction of the offered tokens as well)

https://etherdelta.com/#0xefd57b75cad5ac36ba102a88e34374a7bb68acf3-ETH

The sale order expires in 7 days. I will then burn all unsold tokens of these 90%.

Quote
I had plans to start an own coin and i contact many exchanges including poloniex. Every one replied with the template saying "coins/tokens that are considered as security will not be listed". Any coin that assures interest to hold is considered as security. Even though this is the concept of proof of stake, these kind of coins/tokens are not accepted by many exchanges. 

On what idea you launched this token?  You have plans to list on which exchanges?

Well, that's strange, because technically CLAM and WAVES are then security, and both are listed at Bittrex. Maybe there is a limit? The stake profit is not very high, compared to the 10x increase per year of my token.

So far I didn't contact any exchange, but would be nice if it gets listed on a bigger exchange than EtherDelta. But I guess they wouldn't be interested, if nearly nobody except me has the token.

So, after 7 days one cannot buy the token?  Is it automatic? How do you burn the coins?  Do you burn manually?  I saw your code and there was nothing written about 10 x increase in a year?  On what basis the interest is added to the token and how much percentage for every 16 seconds?
IGCGamers
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
February 02, 2018, 01:49:51 AM
 #15

Thanks for your detailed explanation. Do you think people will buy the tokens from etherdelta?  Why can't you sell directly as an ICO? So all the unsold tokens will be burned after 7 days? If yes, even the 10 percent you hold will be burnt or it will be intact?  What exchanges you have on mind to list the tokens apart from etherdelta? I don't know how CLAM and WAVES are listed. May be they implemented this policy recently. 

I think exchanges like etherdelta are the future, because it is all smart contract based on the Ethereum network, so in theory more safe than conventional exchanges. But I will ask other exchanges as well.

Quote
I have another question.  Assume i have 100 tokens on my wallet and i am getting interest for 100 tokens.  After few days or months, if i sell 50 tokens, my balance will be only 50. On such case, i get the interest for 50 tokens or the initial 100 tokens?  If i sell the tokens, the recipient also gets the interest?

How long the interest will be paid?  Is there any cap for that? Is it life time?

You say that it gets multiplied by 10x. So if some one holds one token, after 12 months, he will have 10 tokens in his wallet?

Each block on the Ethereum network (so about each 16 seconds), 0.000115 % will get added. See this wallet, to which I transferred 10 TENT yesterday:

https://etherscan.io/token/0xefd57b75cad5ac36ba102a88e34374a7bb68acf3?a=0x144e9bbf3dbc6ec9d3a84844d54416e80ac6fb7c

Do a reload each 16 seconds, and you will see that it increases. Until the end of the year it has increased 2 million times, which is 10x (=1.00000115 ^ 2,000,000). But you can always sell and transfer it to another wallet earlier, with all the compound interest that it has so far. Compared to classical bank account, think of it as an interest period of 16 seconds instead of 1 year.

For your example, if you buy 100 tokens today, you will have about 1.00000115 ^ 500,000 * 100 TENTs = 2.117 * 100 TENTs = 211.7 TENT after 3 months in your balance. If you then sell 50 TENTs, the recipient will have 50 TENTs and you will have 161.7 TENTs.

I understand that if i transfer 50 TENTS, i will still have 161.7 TENTS. But do i get the interest for 161.7 TENTS  for every 16 seconds again or i will get the interest for 211.7 tents?  Does the person who received 50 TENTS also will receive the interest for every 16 seconds?

Where is this condition written on your code exactly? I cannot read anything like that on your code?
IGCGamers
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
February 02, 2018, 02:08:30 AM
 #16

For your example, if you buy 100 tokens today, you will have about 1.00000115 ^ 500,000 * 100 TENTs = 2.117 * 100 TENTs = 211.7 TENT after 3 months in your balance.

BTW, for an exact calculation you can use the contract functions:

https://etherscan.io/token/0xefd57b75cad5ac36ba102a88e34374a7bb68acf3?a=0x144e9bbf3dbc6ec9d3a84844d54416e80ac6fb7c#readContract

and click Query on the "facExp" function. The parameters:

k=TENT*10000000000, so e.g. 1000000000000 for this example
q=867598 (always the same value, this is the exponent, expressed as an inverse value)
n=number of blocks, so 500000 for this example
p=8 (always the same value, this is the calculation precision)

The result is 1779448097771. This is just the interest, in smallest TENT units. So it is 177.94. Add this to 100 and you get 277.94, even more than calculated. Try it with 2 million blocks, and you get 1000 for the interest, to which 100 will be added. So I guess I should have named it "Eleven Times" Grin

It even works for very small values. For example if you have just 10 TENT units, that's 0.000000001 TENT, you still get 0.0000000107 TENT at the end of the year, because the calculation is done with the number of blocks as an exponent parameter, not individually by adding the individual interests. And of course it works for 10k TENT or more, too.

And this is good, because if not many people buy it and I burn most of the 90% of the supply as I will do as promised, I can still use my 10% and try to list it at bigger and more classical exchanges.

Where do you derive this percentage 0.000115 %?  I do not see that any where on your code? Why p=8 always? What does it do with the calculation? why 1=867598 always?

Your idea is really good and has to be appreciated? Even if you burn the 90 percent, you can use your 10 percent in future.  Does your 10 percent also gets interest for every 16 seconds?
marilyn4325 (OP)
Full Member
***
Offline Offline

Activity: 229
Merit: 134



View Profile
February 02, 2018, 08:04:51 AM
 #17

I understand that if i transfer 50 TENTS, i will still have 161.7 TENTS. But do i get the interest for 161.7 TENTS  for every 16 seconds again or i will get the interest for 211.7 tents?  Does the person who received 50 TENTS also will receive the interest for every 16 seconds?

Where is this condition written on your code exactly? I cannot read anything like that on your code?

Yes, after you transfer the 50 TENTs, you will get interest for the remaining 161.7 TENTs for each new block. The person who receives the 50 TENTs gets also interest for now his 50 TENTs every new block (= every 16 seconds). The concept is really simple compared to bigger periods like months or years, as you may know from banks Grin

In the code it is a bit more difficult to see:

https://etherscan.io/address/0xefd57b75cad5ac36ba102a88e34374a7bb68acf3#code

The reason is, that I can't add the interest each block, because this would cost way too much gas (= ether fee) and rounding errors would accumulate for small amounts over time. Instead I use lazy evaluation.

The important function here is updateBalance, starting from line 99. This records the start block for an address, if there is not already a start block, and then calculates the interest since the last start block and the current block. This interest is then added to the balance for this address and to the total supply. Whenever a transfer function is called (either "transfer" from line 115, or transferFrom from line 136), first the two involved balances are updated, so that the interest is actually paid for the last blocks. Then the transfer itself happens and because the startBlock map is updated with the current block as well, for the next transfer the next interest can be calculated.

To display the right amount all the time in web wallets etc., the "balanceOf" function uses the same compoundInterest function to calculate the current balance that will be used for the next transfer, but without actually changing the last saved balance from the last transfer call.

So the effect of this is that it looks like you always get your interest added for each block to your balance. But the required optimizations for low gas cost makes this a bit difficult to follow, unless you are a good Solidity programmer.
marilyn4325 (OP)
Full Member
***
Offline Offline

Activity: 229
Merit: 134



View Profile
February 02, 2018, 08:25:44 AM
 #18

Where do you derive this percentage 0.000115 %?  I do not see that any where on your code? Why p=8 always? What does it do with the calculation? why 1=867598 always?

Your idea is really good and has to be appreciated? Even if you burn the 90 percent, you can use your 10 percent in future.  Does your 10 percent also gets interest for every 16 seconds?

The 0.000115 % is a result of my times 10 requirement each 2 million blocks. The formula for compound interest is (1+p%) ^ periods. If I want to have times 10, the formula looks like this: x^n=10. You can solve this by calculating x=10^(1/n) (or the n-th root of 10), which results in x = 1.00000115129 for n = 2000000. The percentage of this factor is (1 - x * 100) = 0.00000115129 * 100 = 0.000115129. I omitted the last digits.

p = 8 is the precision. For details see the article from where I got the function to calculate the exponentiation:

https://ethereum.stackexchange.com/questions/10425/is-there-any-efficient-way-to-compute-the-exponentiation-of-a-fraction-and-an-in

The problem with Solidity is, that you don't have float values and can't just write Math.pow(x, y), as you could do in JavaScript. The formula on stackexchange uses binomial expansion, which allows to calculate the exponentiation with very few steps with good approximation. The number p specifies the number of steps. Higher number of steps result in higher precision, but higher gas cost as well. You can find the mathematical background about binomial expansion here:

https://en.wikipedia.org/wiki/Binomial_theorem

Because of the required form "k * (1+1/q) ^ N" of the formula, I have to convert the 0.000115 % to q, so that 1/q is equal to 0.000115 %. This is the reason for the number 867598. If you calculate 1 / 867598, you get 0.0000011526. This is slightly different from the mathematically result, because I optimized q by hand so that the fracExp function nearly exactly results in times 10 for 2 million blocks (= about one year), my main goal.

I hacked a quick JSFiddle script for you to play with the numbers, and to see what effect the precision p has for the result:

https://jsfiddle.net/u5zgqqn3/embedded/result/

You can see the JavaScript source code here:

https://jsfiddle.net/u5zgqqn3/

It uses the BigNumber library to emulate the Solidity smart contract function fracExp.
marilyn4325 (OP)
Full Member
***
Offline Offline

Activity: 229
Merit: 134



View Profile
February 02, 2018, 11:40:17 AM
 #19

I created the same contract on the Ropsten Testnet, I only changed the ticker symbol to TENTTest and added Test to the name and class name, so that it doesn't get confused with the main net token (I don't think I can use the exact same contract address from the mainnet on the testnet as well).

In MetaMask or MyEtherWallet, choose the Ropsten Testnet and add the token with these parameters:

Token Contract Address: 0x58e45f485743a7c792daeba93456eb9ba0f28cd2
Token Symbol: TENTTest
Decimals: 10

Here you can see the verified source code, same as the original, except for the name changes:

https://ropsten.etherscan.io/address/0x58e45f485743a7c792daeba93456eb9ba0f28cd2#code

Here you can get free ether for the Ropsten testnet, so that you can test transferring TENTTest tokens to other addresses, which costs ether gas fee:

http://faucet.ropsten.be:3001

PM or reply here with your Ropsten testnet ether address, if you want some TENTTest tokens on the testnet for free to play with it, and to verify if it works as I described it, if you can transfer it, if the interest changes are displayed in your wallet etc., and I'll send you 1000 tokens.
IGCGamers
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
February 04, 2018, 01:22:19 PM
 #20

I understand that if i transfer 50 TENTS, i will still have 161.7 TENTS. But do i get the interest for 161.7 TENTS  for every 16 seconds again or i will get the interest for 211.7 tents?  Does the person who received 50 TENTS also will receive the interest for every 16 seconds?

Where is this condition written on your code exactly? I cannot read anything like that on your code?

Yes, after you transfer the 50 TENTs, you will get interest for the remaining 161.7 TENTs for each new block. The person who receives the 50 TENTs gets also interest for now his 50 TENTs every new block (= every 16 seconds). The concept is really simple compared to bigger periods like months or years, as you may know from banks Grin

In the code it is a bit more difficult to see:

https://etherscan.io/address/0xefd57b75cad5ac36ba102a88e34374a7bb68acf3#code

The reason is, that I can't add the interest each block, because this would cost way too much gas (= ether fee) and rounding errors would accumulate for small amounts over time. Instead I use lazy evaluation.

The important function here is updateBalance, starting from line 99. This records the start block for an address, if there is not already a start block, and then calculates the interest since the last start block and the current block. This interest is then added to the balance for this address and to the total supply. Whenever a transfer function is called (either "transfer" from line 115, or transferFrom from line 136), first the two involved balances are updated, so that the interest is actually paid for the last blocks. Then the transfer itself happens and because the startBlock map is updated with the current block as well, for the next transfer the next interest can be calculated.

To display the right amount all the time in web wallets etc., the "balanceOf" function uses the same compoundInterest function to calculate the current balance that will be used for the next transfer, but without actually changing the last saved balance from the last transfer call.

So the effect of this is that it looks like you always get your interest added for each block to your balance. But the required optimizations for low gas cost makes this a bit difficult to follow, unless you are a good Solidity programmer.

Sorry for the delayed response. Thank you for your clarifications. I still have the following questions:

1) Is the interest paid life time or there is a limit for that? If the interest is paid life long, the demand will decrease right. Because you have a initial supply of 1 million tokens?  That 1 million token may become 11 million token in a year and it keeps increasing right? Please correct me if i am wrong and clarify me please.

2) How much gas (In eth value) is required for each transaction? I mean if i transfer the token to some one, how much i have to spend in ETH for each tranaction?

3) On what calculation you derive the compoundInterest? Is it not possible to reduce the total 10x to 5x or 3x annually?  If the constant number 867598 is reduced to 433284, will the interest get reduced to half? What made you offer 11x interest?

Ill reply with more questions on the next reply...
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!