2

You need both. You use Solidity for the contract, or Vyper less commonly. You also usually need front-end and possibly server interactions. Those are usually but not necessarily JavaScript. Hope it helps.


1

Ethereum doesn't do that. You need a price source which could be on-chain or off-chain. Off-chain would be an exchange or other service, e.g CoinMarketCap and that would be an API. On-chain could be a price Oracle or liquidity pool, e.g. ChainLink or Uniswap. There are many in both cases. Hope it helps.


1

I solved this problem by creating a new child smart contract and deploying a new instance (with a new address) for each user upon his first access to the parent contract: contract userWallet is IERC20 { ... } then in the parent contract: _userWallet[_msgSender()] = address(new userWallet(...));


1

There's not fixed rule, but usually part of a dapp may work on-chain and part off-chain. While a static frontend with some js can satisfy the former, the latter may require additional resources (e.g. bandwith, database, mail services, ...). ...btw many projects are still hosting on cheap VPS instead of the cloud ;)


1

As answered by Alexey, the error happens because of undefined defaultAccount property. The work around for it in javascript is adding the below statement web3.eth.defaultAccount = ethereum._state.accounts[0] Here we have used ethereum._state.accounts[0] instead of web3.eth.accounts[0] since it is deprecated to be used by metamask as documented in the ...


Only top voted, non community-wiki answers of a minimum length are eligible