You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// encodeState encodes the state as with abi.encode() in the smart contracts.
func computePoolAddress(a, b []byte) ([]byte, error) {
args := abi.Arguments{
{Type: abiUint256},
{Type: abiUint256},
}
enc, err := args.Pack(
a,
b,
)
// now you have abi.encode(a,b)
h := crypto.Keccak256(enc)
// now you have keccak(abi.encode(a,b))
// return the last 20 bytes
return h[12:]
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: