2

Question 1: What do you think ? Am I right about Solution above ? Agree. To prevent front-running, use a factor like msg.sender in the hash function so the front-runner can know the secret and still be unable to use that knowledge. For example, consider a piggy bank with a secret word that releases the money. If the withdraw function uses (pseudo) hash(...


1

It's not madness. On-chain deployment patterns are one way to establish trust between separate contracts. But, you are running into a classic problem. When a contract A deploys another contract B, the bytecode for contract B gets rolled up into the bytecode for contract A. This is so contract A knows what to do. Reducing the size of the deployed contract is ...


1

First, I am not an expert on this and you can very well see me as a beginner. This upfront cost is gas price * gas you are sending which is set in your config. This does not necessarily match the real cost. What is important is how much gas your deployment will cost. The rest of the gas sent will not be used. In your case, you are willing to pay: ...


1

Ganache is as server node to ethereum chain and you can using standart ethereum rpc api (attention, look port , default,7545 , but bettet to check, see here more details about configuration ganache https://www.trufflesuite.com/docs/ganache/reference/workspace-default-configuration) For calling method to only getting data from smart you should using https://...


1

Some remarks: Usually commit and reveal phases are separated such that no commit message are allowed after certain point. That way if someone send a reveal message an attacker no longer can send a commit with the answer. The committed message must include something extra that an attacker cannot alter like msg.sender or something he cannot guess like a ...


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