OGCATS randomization notes

Xyz Zyx
2 min readDec 15, 2021

some notes for about the randomization process in OGCats

future of OGCATS

Random number from Chainlink https://dashboard.tenderly.co/tx/polygon/0xde5e65da5017c7cb852ab7e21aaad54ee638f2cae7d68c4cc1697c59f141cc2b/logs


too big to work with, cut it to 18 decimals. shuffle an array from 0–1000 using it as seed.


package main

import (

const chainlinkRandomNumber = "33481218050282424732010044081128699987812287782893023053970080888682140917516"

//max int64 -> random number from chainlink will be cut to 18 digits
//9223372036854775807 -> this is max int64 in go, as max value for 'seed'
func main() {
fmt.Printf("running script at @ unix nano %d\n", time.Now().UnixNano())

//chainlinkRandomNumber is too big, get the first 18 digits
seedStr := chainlinkRandomNumber[0:18]
seed, err := strconv.ParseInt(seedStr, 10, 64)
if err != nil {


var nftIDs []int
for i := 1; i <= 1000; i++ {
nftIDs = append(nftIDs, i)

rand.Shuffle(len(nftIDs), func(i, j int) {
nftIDs[i], nftIDs[j] = nftIDs[j], nftIDs[i]

printToFile("shuffled.txt", nftIDs)

func printToFile(filePath string, values []int) {
f, err := os.Create(filePath)
if err != nil {
defer f.Close()
for _, value := range values {
fmt.Fprintln(f, value) // print values to f, one per line

returning: 786,555,370,779,622,375,418,816,598,273,905,822,503,130,…. etc

Hash of the original images (unrandomized). Note that the rare ones are first 23!


sha256sum random_images/786.jpg

7510500f1f2a51942e50c97c70063be76ee5f81d76f0cbf5165199a33a019bdc random_images/786.jpg

sha256sum images/0.jpg

7510500f1f2a51942e50c97c70063be76ee5f81d76f0cbf5165199a33a019bdc images/0.jpg


since the NFTs start from 1, I moved the 0.jpg/json to 1000.jpg/json (note to self: tweak the script next time)


PS. Q.E.D. or QED is an initialism of the Latin phrase quod erat demonstrandum, meaning “which was to be demonstrated”. Literally it states “what was to be shown”.[1] Traditionally, the abbreviation is placed at the end of mathematical proofs and philosophical arguments in print publications, to indicate that the proof or the argument is complete.

meaning the randomization process was random and we didn’t keep the rare ones for ourselves.

PS2. Looking for a smart contract audit ? https://to.wtf is the best place to start. Competitive rates and (usually) 24h delivery