Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: myapple on February 01, 2018, 01:02:48 PM



Title: Where can I find the various Ethereum token contract solitidy source code
Post by: myapple on February 01, 2018, 01:02:48 PM
Thanks


Title: Re: Where can I find the various Ethereum token contract solitidy source code
Post by: Xynerise on February 01, 2018, 04:32:23 PM
Do you want sample codes or existing codes for various tokens?
If it's the former, check Consensys' GitHub page, they have a number of standard token examples.
If it's the latter then check the contract source tab on the etherscan page of the token's contract address.
P.S Not everyone will share the code to their smart contract, although for an ICO it is deemed as a mark of transparency if they do so.


Title: Re: Where can I find the various Ethereum token contract solitidy source code
Post by: myapple on February 02, 2018, 08:43:25 AM
Thanks
If there is a deployed contract but the code hidden i think maybe there will be some unknown behavior causing some problem ?
Whether the codes can be forced to be public?
Also is it possible to reset the exchange rate from my coin to ether dynamically ?
So after the address received ether it will automatically send out my coin to the same address based on the dynamic exchange rate ?
Any sample code for this


Title: Re: Where can I find the various Ethereum token contract solitidy source code
Post by: niteroy on February 02, 2018, 09:19:07 AM
Price token is taken from the calculation of its market value on crypto currency Exchange Act. You can find you are interested token ERC-20 with its description and complete information on: https://etherscan.io/token/


Title: Re: Where can I find the various Ethereum token contract solitidy source code
Post by: terible.hunter on February 02, 2018, 10:05:17 AM
I think if you need an example of a conventional smart contract, then you can find it on the site ethereum. On their official website there is a lot of useful information for those who really want to learn how to create smart contractors.


Title: Re: Where can I find the various Ethereum token contract solitidy source code
Post by: Xynerise on February 02, 2018, 02:31:36 PM
Thanks
If there is a deployed contract but the code hidden i think maybe there will be some unknown behavior causing some problem ?
Whether the codes can be forced to be public?
You can't force a code to be open source.
The person that deployed the smart contract does NOT have to make the source code available.
However, the bytecode of EVERY ethereum smart contract is always available and since tokens aren't arbitrarily complex, it is possible to reverse-engineer a token.

Quote
Also is it possible to reset the exchange rate from my coin to ether dynamically ?
So after the address received ether it will automatically send out my coin to the same address based on the dynamic exchange rate ?
Any sample code for this

It should be possible theoretically, that a contract can be able to deduce the exchange rate of a token through Oracle's, however it is impossible for a contract to act on its own.
Contracts MUST always be called and they cannot call themselves so it's impossible for the token to make a transaction by itself without an external call.
Someone made an  Ethereum Alarm Clock (http://docs.ethereum-alarm-clock.com/en/latest/) so you can schedule events to be called later.