Categories
Cryptocurrency Ethereum Mastering Development

Reason for a transaction and 2 cancelling transactions being stuck?

I sent a transaction. Shortly after, I decided to cancel it, so made a cancel transaction (using MetaMask). After a while, since nothing was happening, I sped up the cancel transaction, i.e. sent a 2nd cancel transaction with more gas. Now 20 minutes have passed and I see all 3 transactions in Etherscan with state […]

Categories
Cryptocurrency Ethereum Mastering Development

does solidity round decimals to ceil or floor them?

so lets say result of a calculation in solidity is 0.2 or 0.8, when I save that result in a variable does that convert to 0 or 1 ?

Categories
Cryptocurrency Ethereum Mastering Development

does solidity round decimals to ceil or floor them?

so lets say result of a calculation in solidity is 0.2 or 0.8, when I save that result in a variable does that convert to 0 or 1 ?

Categories
Cryptocurrency Ethereum Mastering Development

Messaging platform with public-private key pairs as identifier

Is there any platform available for Ethereum address 0x1d53.. to message 0xcc23…, and so on? It seems like there would be a lot of demand for something like that, which suggests it exists. Off-chain, I guess. I need it for the pairs in Pseudonym Pairs (source code) to agree on a random video channel over […]

Categories
Cryptocurrency Ethereum Mastering Development

ERC Tokens – what can I do with it?

I don’t quite understand the hype behind erc tokens. As I understand it, it is basically an interface for a solidity contract. So what exactly is the big deal about? The only positive I see is that it allows you to make a well-structured contracts.

Categories
Cryptocurrency Ethereum Mastering Development

How do i test “it” methods with truffle?

I have this contract: contract(‘MetaCoin’, (accounts) => { it(‘should put 10000 MetaCoin in the first account’, async () => { const metaCoinInstance = await MetaCoin.deployed(); const balance = await metaCoinInstance.getBalance.call(accounts[0]); assert.equal(balance.valueOf(), 10000, "10000 wasn’t in the first account"); }); it("thing test", async () => { const thing = await Thing.deployed(); const res = await thing.specialThing.call(2, […]

Categories
Cryptocurrency Ethereum Mastering Development

Understanding eth_estimateGas with regards to gas price, and current mempool

Does anyone have a detailed understanding of how eth_estimateGas works with regards to gasPrice and the current mempool state? I have historically seen some really odd behavior when using eth_estimateGas on mainnet. I’ve seen both false positives and false negatives. In other words, I’ve seen an eth_estimateGas that tells me a tx would fail only […]

Categories
Cryptocurrency Ethereum Mastering Development

How to change the sender of a function call?

I have this code from truffle unbox metacoin: ontract(‘MetaCoin’, (accounts) => { it(‘should put 10000 MetaCoin in the first account’, async () => { const metaCoinInstance = await MetaCoin.deployed(); const balance = await metaCoinInstance.getBalance.call(accounts[0]); assert.equal(balance.valueOf(), 10000, "10000 wasn’t in the first account"); }); Which account has deployed Metacoin? Is it accounts[0]? How do I change […]

Categories
Cryptocurrency Ethereum Mastering Development

Why do I get big number occasionally wherever I call Smart Contract functions using web3js?

I have column named total balance, which has a type of uint and function named getBalance which return its balance and the corresponding functionality has been also declared in Web3js..They get called automatically on page load.. Now Whenever I refresh the page, I get 3963877391197344453575983046348115674221700746820753546331.534351508065746944 sometimes not always..What is the case behind these ?? is […]

Categories
Cryptocurrency Ethereum Mastering Development

ERC721 _holderTokens

The ERC721.sol provided by OpenZeppelin has a variable _holderTokens which is private. If I am writing my smart contract which inherits from ERC721.sol, is there any way to make that variable public so everyone can access it?