struct NftOpenMinterState { bytes nftScript; bytes merkleRoot; int nextLocalId; } struct NftMerkleLeaf { bytes commitScript; int localId; bool isMined; } library NftOpenMinterProto { static function stateHash(NftOpenMinterState _state) : bytes { return hash160(_state.nftScript + _state.merkleRoot + pack(_state.nextLocalId)); } static function nftMerkleLeafToString(NftMerkleLeaf leaf) : bytes { bytes isMinedByte = leaf.isMined ? b'01' : b'00'; return leaf.commitScript + pack(leaf.localId) + isMinedByte; } }