New answers tagged

1

A smart contract can have lots of functions, so to achieve what you want you would have to test each of them independently. You would have to think about all possible inputs that can be given to the functions. Basic TypeScript example in a mocha test suite: describe("my exhaustive test suite", function() { it("checks that foo doesn't change ...


0

There are different ways to to this. First, you may just embed the data into smart contract's code like this: contract Foo { string public constant bar = "Hello, World!"; } Second, you may pass the data as a constructor parameter: contract Foo { constructor (string memory _bar) public { } } In this example, constructor doesn't do anything ...


0

You can put in the data field any arbitrary data, but the transaction has a size limit, is about 780kB AFAIK.


1

I think you missed this part: In this implementation, a vote for choice1 will take the form: 1-my_secret_password and a vote for choice2 will take the form: 2-my_other_secret_password Notice that the 1 and 2 are the actual votes. The passwords are included to make sure votes remain secret until the reveal period. Each vote is required to use a unique ...


1

Yes it is secure. If you don't pass entropy to it, it will use randomhex, see Web3 docs. That uses the secure crypto.randomBytes function which is pretty secure. It's just a wrapper around OpenSSL's RAND_bytes().


3

From this reddit message it was fixed in geth 1.6.5 https://www.reddit.com/r/ethereum/comments/6ene3u/the_attacker_is_back_account_related_to_devcon2/ Pull request with the fix: https://github.com/ethereum/go-ethereum/pull/14570 core/vm: Use a bitmap instead of a map for jumpdest analysis


0

There are randomness oracles like Chainlink VRF available nowadays.


1

It is a very general question, so a very general answer. Try-catch is a logical branching technique, and logic errors can have serious security implications. What implications can it have to the security of a function A function should always do exactly what it is supposed to do, in all cases. That should be obvious. It is not always wrong to try-...


0

Very good answers above but please note the change in syntax in the latest version of Solidity. From Solidity Docs: address(nameReg).call{gas: 1000000, value: 1 ether}(abi.encodeWithSignature("register(string)", "MyName"));


0

Most Ethereum nodes already operate by having only the current state. This is also known as a full node. What you are describing is called an Archive node. A node launched normally keeps only the current state. For example, you cannot query past balances of Ethereum addresses. Archive node allows you to query the full transaction history.


0

Neither the hundreds of blogposts around the so-called Trilemma nor Zooko’s original triangle depict reality and are far from mathematical proofs. Just like you, I cannot picture good cases, where security and decentralization are at odds and I would say in most cases they actually go hand-in-hand. If Bitcoin gets too centralized (mining pools) the risk of ...


1

So, you have a validator node VAL0 and the sentry nodes SEN1, SEN2, and SEN3 according to your single layer sentry node setup above. I would encourage to manage networking through a firewall, i.e., UFW, but you can also add other layers at will, i.e., physical network topology. As validator client and beacon nodes we use Lighthouse which configures it's ...


Top 50 recent answers are included