This repository has been archived by the owner on Aug 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
X and Y genes in the Ronin blockchain #10
Comments
I tried to concatenate the X and Y gene strings, but nothing was happened. const axieState = await axieContract.methods.axie(4950464).call()
const sha512 = crypto
.createHash('sha512')
.update(axieState.genes.x + axieState.genes.y)
.digest('hex')
const axieGene = new AxieGene(sha512, HexType.Bit512) Error: cannot recognize class |
Ensure that the sha512 value that you're passing is a string of hex prefixed with 0x |
Generated |
I found the answer, here is it: const axieState = await axieContract.methods.axie(4950464).call()
const x = BigInt(axieState.genes.x).toString(2).padStart(256, '0')
const y = BigInt(axieState.genes.y).toString(2).padStart(256, '0')
const z = BigInt('0b' + (x + y)).toString(16)
const axieGene = new AxieGene(z, HexType.Bit512) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello, at the moment I am analyzing the Ronin blockchain and cannot figure out how the axie body parts and genes can be decoded.
The code I ran:
RPC Response:
Can your library help me get genes for the
genes.x
andgenes.y
I have?Do you have any idea how to convert this to the SHA hash your library needs?
The text was updated successfully, but these errors were encountered: