This forum is a read-only archive. Posting, replying and signing in are disabled.

Algorand smart contracts with Solidity or JS

sid

Is Python the only option through which ALgorand smart contracts can be built and deployed or can we use Solidity or JS?
Any documentation for that?

Maugli

Hi, @sid,
There are numerous APIs you can use: JS, Go, PHP, Java.
Regarding the Algorand contracts, you can program them using Teal, PyTeal, Reach, etc.
but alas, no Solidity…

sid

Why API’s? I want to write my own smart contracts with custom logic. How do APIs help here?
Also, why does every promising blockchain platform use a new language to support smart contracts? Why can’t something like Solidity be the norm for all smart contracts as it would make it easy to devs to write once and port anywhere and all blockchain platforms to ship with a solidity compiler

Maugli

Ok, @sid , API is needed to compile your smart contract and “create” it on the blockchain, e.g. send money to the contract. Solidity would be great for Algorand as well, the problem is that the Algorand contracts are not able to store state information at all. In Algorand, Application calls are used for storing state info, but state info is very limited: 64 key/value pairs in every App. (and this could be a little extended with further page allocation). The fact is, you can’t make general contracts, for example a name registry, where you store a DNS name for an address – simply there is no support for that in the blockchain at present