I recently stumbled upon Falsehoods programmers believe about time zones, which got a good laugh out of me. It reminded me of other great lists of falsehoods, such as about names or time, and made me look for an equivalent for Ethereum. Having found none, here is my humble contribution to this set.
Calling estimateGas
will return the gas required by my transaction
Calling estimateGas
will return the gas that your transaction would require if it were mined now. The current state of the chain may be very different to the state in which your tx will get mined. So when your tx i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import CryptoSwift | |
//https://github.com/ethereum/EIPs/blob/master/EIPS/eip-137.md | |
extension String { | |
public var namehash: String { | |
var node = Array<UInt8>.init(repeating: 0x0, count: 32) | |
if self.count > 0 { | |
node = self.split(separator: ".") | |
.map { Array($0.utf8).sha3(.keccak256) } |