<p id="result"></p>
<script>
//
// These parameters will be filled with the Teia core team multisig execute proposal
// transaction information.
// They are now filled with example values from the last executed proposal:
// https://tzkt.io/onjFdmaJMmZ7y12CmNDZTsxKZU41JTBYFJTdVtneToKCwNvAamV
//
let operationHash = "onjFdmaJMmZ7y12CmNDZTsxKZU41JTBYFJTdVtneToKCwNvAamV"
let operationBlock = 3267596
//
// Random number generator used by fxhash
// https://www.fxhash.xyz/doc/artist/snippet-api#snippet-code
//
var fxhash = operationHash
let alphabet = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
let b58dec = (str) => [...str].reduce((p, c) => (p * alphabet.length + alphabet.indexOf(c)) | 0, 0)
let fxhashTrunc = fxhash.slice(2)
let regex = new RegExp(".{" + ((fxhash.length / 4) | 0) + "}", "g")
let hashes = fxhashTrunc.match(regex).map((h) => b58dec(h))
let sfc32 = (a, b, c, d) => {
return () => {
a |= 0
b |= 0
c |= 0
d |= 0
var t = (((a + b) | 0) + d) | 0
d = (d + 1) | 0
a = b ^ (b >>> 9)
b = (c + (c << 3)) | 0
c = (c << 21) | (c >>> 11)
c = (c + t) | 0
return (t >>> 0) / 4294967296
}
}
var fxrand = sfc32(...hashes)
//
// Calculate the block level where the hDAO snapshot will take place
//
const hdaoSnapshotBlock = Math.round(operationBlock - 200000 * fxrand())
document.getElementById("result").innerHTML = "The hDAO snapshot will take place on block " + hdaoSnapshotBlock
</script>
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.