I had the same problem and I solved it setting the Solidity compiler version to 0.6.8 (the latest at the current moment).
This can be done on Remix in the Compiler section, or in Truffle editing the file truffle-config.js.
They wont be able to sell them immediately. The "real" actual price of any token is how much someone is actually willing to pay for it. It might be "worth" $1B in that exchange's eyes but that only means that exchange values it at $1B.
No other third party has to buy it back from you at the $1B valuation.
The ERC-20 is a public standard which means contracts all have to support the identical ABI. You'll find the ERC-20 ABI on many places online, e.g., https://github.com/ethereum/wiki/wiki/Contract-ERC20-ABI.
As a general rule, if you want to communicate with a contract that does not follow any standards, you will need the ABI from the creator of the contract ...
You cannot use floating point numbers to interact with cryptocurrency, or any monetary units. You need to use a special helper class called BigNumber.js to do the math. Then you convert those numbers to strings before passing them to functions that go to JSON-RPC interface.
The native word size of Ethereum virtual machine is uint256. There is no really need to use smaller words, like u128 or u64 for accounting purposes, as there are no real gas efficiency gains. Thus, it is practical to use the uint256 EVM wise.
Note that arguments are RLP packed when communicated to the EVM, so any leading zeroes do not increase the cost, as ...
The function you need to make this is transfer(address, value).
You have to be the owner of the contract to call this function.
You can make this changes locally using ganache and calling the method transfer(address, value) from your contract. If you want to make this directly in the EVM you need to use Infura that would give you the link to the network you ...
A good starting point would be to learn the basics of Smart Contracts.
Solidity Banking example
This blog post covers the basics of handling ETH with a solidity smart contract:
And finally, you mentioned ...
Contracts can't detect when tokens are being transferred to them. Contracts can only check a token balance but they have no idea when they have received tokens unless someone tells them so. So you can't make this automatic inside the blockchain. So what you need to do is monitor the token transfers outside the blockchain and when you notice that tokens are ...
Most (if not all) of the wallets you mentioned are non-custodial, meaning that they do not control your funds. If a service were to go down, you can simply go to another and use your private key there. Funds are stored on the blockchain directly, not on the service itself.
This is different from custodial wallets or services (e.g. Coinbase). Those services ...
You have basically three options.
You can use truffle-flattener to create a file that contains all the imported contract's source codes. The result can be used to easily verify a contract on Etherscan.
You may also try truffle-plugin-verify if you are using Truffle. You'll need an API key from Etherscan for ...
Just to supplement @Thiago's valid answer.
Transactions can't be directly cancelled or upgraded. The only thing you can do is send a new transaction with the same nonce but with higher gas price. If your new transaction get mined first (as it probably will as it has higher gas price) then the old transaction becomes obsolete as it has the same nonce.
Yes, i’m pretty sure it comes from the fact that my Crowdsale contract have no supply has you said. I was expecting to do the transfer from the Token.sol Smartcontract, but in fact, i need to do it in the Test script ? So i can’t make it an automatism ? I will need to transfer manually the supply from the token to the crowdsale after their deployments ?
I did a search and assume this is your token:
If you are creating ERC20 tokens you may want to look at the OpenZeppelin Contracts implementation to see if this meets your needs. See the documentation for details: https://docs.openzeppelin.com/contracts/3.x/erc20
If you have ...
I gave Tirtha credit, because his answer is correct and the one that helped me. I'd just like to piggyback on his answer to elaborate a bit more.
The reason why Metamask wasn't presenting me with an "approve" transaction is because Owner is the one invoking approve, not my selected Remix account. I'm only calling Owner.transfer, which then tells Owner to ...
I'm calling it from an address with 10000 ERC20 tokens
You need to have the tokens in the Owner contract. As the owner contract is the one that is calling approve.
The failure is happening because there aren't enough ERC20 tokens in the Owner contract. Transfer 50 to that from your user wallet and then call the function.
Your crowdsale contract has no tokens to transfer to the buyer.
You transfer ownership of the Token Contract in your test file, but the total supply is still in control of the Token Contract deployer address . From the looks of it should be your account.
After both your contract have been instantiated, you will need to do something like:
You are right that the main disadvantage, however, instead of replacing the ERC20 functionality with something else, you can add the functionality on top of your token. Think of it as a ERC20+.
Instead of replacing balanceOf(address) with balanceOf(string), you could add namedBalance(string) and leave balanceOf(address) to operate with the rest of the ...
The primary designation of the decimals function is off-chain display (it doesn't mean that it should not be used on-chain, but you should consider it very carefully before being tempted to do so).
This function can be used in order to avoid the need for displaying very low significant digits.
For example, instead of displaying 1234567890000000000 wei, you ...
There's some leads in the transaction receipt
When status is set to 0 it means the transaction has failed.
The base transaction cost is 21000 which is close to 24300 gas used, so the contract didn't avanced very much, for example it didn't write to storage yet.
You will have to check the conditions used by requires early in ...
Your code seems to be correct.
The Ethereum network is asynchronous. The new state may have not propagated fully through network in the point you are doing read immediately after read. Also there might be minor blockchain reorganisations making transactions hop between blocks.
However none of thus should be a concern for a local chain with a single miner, ...