I create NFT
https://i.stack.imgur.com/8JqmK.png
How i can create NFT levels like this ?
https://i.stack.imgur.com/lg8kt.png
Im using python and brownie for compile and deploying smart-contract.
You can investigate the DNA algorithm.
In simple:
Your NFT struct should contain a field like: NDA or characteristic
The value of field above is: 0xAF125689
Expose this field into your backend service
You can split the value above into pairs [AF, 12, 56, 89], each pair identify for a property, can be level, skin...
Related
I'm wondering how to retrieve all minted tokenIDs by a certain ERC721 contract?
What I'm trying to do is retrieve an array with all minted tokenIDs.
For example:
I want to have a function that returns an array of tokenIds that exist.
Let's say 1 and 48 (max supply) are minted the function needs to return: [1,48]. This means I still have 2-47 left to be minted
I couldn't find anything about this only solutions where you would have to enter an address or an index.
I would like to compute the sha256 of a string in a Free TON-Solidity contract, I do it by storing the string in a TvmBuilder and then passing it as a TvmSlice to sha256(), but the result is not correct (it doesn't match the one computed by sha256sum in my shell). Any idea why ?
Is the TvmBuilder adding some bits that are passed in the slice ?
Yes, tvm builder is kind of TL-B scheme serializer as far as I understand
sha256() function in Free TON Solidity API only takes a TvmBuilder as input, You can compute the hash for a raw string.
Hashing arbitrary string is hashing its BOC , because BOC is the only structure tvm can understand
i think you may want to build BOC out of this string. builder builds cells and cell layout is made of slices + refs. it results in a tree structure of slices mixed with refs, which resolve in blockchain state.
your approach should work for small strings as well as it works with the whole blockchain state. that’s the only way tvm understands data
so hash of string is hash of a cell which has proofs for underlying cells
that’s the way i now understand it, hope that helps.
and if you have string less than 127 bytes, you can pass bytes instead and hash bytes packed in a single cell
tg #freeton_smartcontracts here where clever SmC guys can clarify , because i’m self learner, not really hands on SmC pro
https://github.com/move-ton/ton-client-py/blob/b06b333e6f5582aa1888121cca80424b614e092c/tonclient/abi.py#L49
maybe this or rust core sdk help you
I am using the Envelope_3 package of CGAL-4.9.1 and I need to compute an upper envelope where the resulting envelope diagram (Envelope_diagram_2<EnvTraits>) could have edges of three different types:
segments
rays
parabolic arcs (conic arcs)
The three provided models of Envelope_Traits_3 are not enough for this.
I therefore need to create my own EnvTraits (which have to be a model of the concept Envelope_Traits_3).
For now, I made a something like the already provided Env_sphere_traits_3<ConicTraits> model, with which I have at my disposal both parabolic arcs and segments (I just use straight arcs).
The problem arises because I also need to be able to use Rays. How could I do this? Is there a Traits class that I can extend (just like I'm doing right now with Arr_conic_traits_2) that provides X_monotone_curve_2s that can be of the three types that I need?
I found the Arr_polycurve_traits_2 class, hoping that it would allow curves of different type to be stored as subcurves, but it actually just allows to store polycurves that are all of the same kind (linear, bezier, conic, circular...).
What you need is a model of the EnvelopeTraits_3 concept and of the ArrangementOpenBoundaryTraits_2 concept. Among all traits classes provided by the "2D Arrangements" package only instances of the templates Arr_linear_traits_2, Arr_rational_function_traits_2, and Arr_algebraic_segment_traits_2 are models of the later concept.
I suggest that you develop something like Env_your_object_traits_3<AlgebraicTraits_2>, where the template parameter AlgebraicTraits_2 can be substituted with an instance of Arr_algebraic_segment_traits_2.
Efi
We have code to interrogate the values from various EMV TLVs.
However, in the case of PED serial number, the spec for tag "9F1E" at
http://www.emvlab.org/emvtags/
has:-
Name Description Source Format Template Tag Length P/C Interface
Device (IFD) Serial Number Unique and permanent serial number assigned
to the IFD by the manufacturer Terminal an 8 9F1E 8 primitive
But the above gives a limit of 8, while we have VeriFone PEDs with 9-long SNs.
So sample code relying on tag "9F1E" cannot retrieve the full length.
int GetPPSerialNumber()
{
int rc = -1;
rc = GetTLV("9F1E", &resultCharArray);
return rc;
}
In the above, GetTLV() is written to take a tag arg and populate the value to a char array.
Have any developers found a nice way to retrieve the full 9?
You're correct -- there is a mis-match here. The good thing about TLV is that you don't really need a specification to tell you how long the value is going to be. Your GetTLV() is imposing this restriction itself; the obvious solution is to relax this.
We actually don't even look at the documented lengths on the TLV-parsing level. Each tag is mapped to an associated entity in the BL (sometimes more than one thanks to the schemes going their own routes for contactless), and we get to choose which entities we want to impose a length restriction on there.
struct stud
{
char name[10];
int rno;
}s[10];
I want to send the data of structure array s from a kernel module to a file in userspace. One way is to combine the data to form a string and send through copy_to_user() but it'll further require tokenization to separate out the data in userspace.
Plz suggest some effective method.
#Gaurav, go through the below link and decide upon which mechanism to use to transfer data from kernel space to user space or vice-versa.
http://people.ee.ethz.ch/~arkeller/linux/kernel_user_space_howto.html
Hope link helps to solve your problem!.