Categories
Cryptocurrency Ethereum Mastering Development

How do I simulate multiple users in a remix unit test?

In the following example, I want to test the assignVoter functionality with Remix unit test plugin. assignVoter should only be called by the owner. contract Ballot { function assignVoter(address voter) { require(msg.sender == owner); } } contract BallotTest { Ballot private ballot; /// #sender: account-0 function beforeAll() public { ballot = new Ballot(…); } /// […]

Categories
Cryptocurrency Ethereum Mastering Development

Abstract contract not inheriting constructor from parent abstract contract

I’m using solidity 0.7.1 and I seem to be running into issues while inheriting from an abstract contract. Specifically with the open zeppelin library, now I’m not creating an issue there because their code seems correct. Moreover my issue seems rather to be a lack of understanding on my part or a potential flaw in […]

Categories
Cryptocurrency Ethereum Mastering Development

How to deposit ETH into my contract from React front-end with web3.js, truffle, ganache?

currently, I’m struggling to solve an error that occurs when a user deposits funds into a contract from the react.js interface. ●Environment Solidity Compiler 0.6.0 Blockchain: Ganache 2.4.0 Web3: web3@1.2.11 React: 2.0.5 ●The error message is here: Unhandled Rejection (Error): while converting number to string, invalid number value ”, should be a number matching (^-?[0-9.]+). […]

Categories
Cryptocurrency Ethereum Mastering Development

How to deposit ETH into my contract from React front-end with web3.js, truffle, ganache?

currently, I’m struggling to solve an error that occurs when a user deposits funds into a contract from the react.js interface. ●Environment Solidity Compiler 0.6.0 Blockchain: Ganache 2.4.0 Web3: web3@1.2.11 React: 2.0.5 ●The error message is here: Unhandled Rejection (Error): while converting number to string, invalid number value ”, should be a number matching (^-?[0-9.]+). […]

Categories
Bitcoin Cryptocurrency Mastering Development

Difference between crypto coin vs crypto block?

I have several doubts about cryptocurrency when I started(bitcoin) reading about it. I google it around and it only added to more confusion. I am not able to understand the difference between a bitcoin transaction block and a bitcoin as a coin. Aren’t bitcoin currency also a bitcoin transaction block in case of a newly […]

Categories
Cryptocurrency Ethereum Mastering Development

How to deposit ETH into my contract from React front-end with web3.js, truffle, ganache?

currently, I’m struggling to solve an error that occurs when a user deposits funds into a contract from the react.js interface. ●Environment Solidity Compiler 0.6.0 Blockchain: Ganache 2.4.0 Web3: web3@1.2.11 React: 2.0.5 ●The error message is here: Unhandled Rejection (Error): while converting number to string, invalid number value ”, should be a number matching (^-?[0-9.]+). […]

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 […]