New answers tagged


When a transaction is reverted (e.g. due to a bad instruction or it runs out of gas), any ETH sent in that transaction is returned, except for the gas. You can calculate this with Gas Price * Gas Limit. You did not send any ETH in this transaction, but the transaction used 400,000 units of gas, with a gas price of 46 Gwei, resulting in 0.0184 ETH that is not ...


A blockchain oracle is any device or entity that connects a deterministic blockchain with off-chain data. Smart contracts cannot make API calls themselves because they are deterministic, but without being able to interact with data the lives off-chain, they won't be able to utilize the decentrality, security, and reliability a smart contract has. To get data ...


If you generate a random number in solidity, you're going to need to look offchain at some point, otherwise the miners could manipulate any type of random number generator using the blockhash. A naive approach to get a random number in an application where you're OK with it being 'hackable': function random() private view returns(uint){ return uint(...


If Chainlink fees are too much, you can always also create your own random beacon that posts random numbers to a blockchain. Then run this at $5 DigitalOcean node and some ETH on the hot wallet to post numbers frequently enough for your use case.

Top 50 recent answers are included