-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mint multiple NEP11 tokens causes Peek out of bounds: 0/0 #1224
Comments
I'll take a look |
Could you provide any contract source code, the compiler version, or the .nef, .manifest.json, .nefdbgnfo, dumpnef? |
@shargon can you please check this logic here, the problem is caused by this check:
if you call a |
simply do this will reproduce the issue. public static void MultiMint(UInt160 to)
{
TotalSupply++;
TotalSupply++;
} |
this is supposed to be the instance, and because is static, should be null :S |
|
A bug in the compilation of # Method Start Neo.SmartContract.Framework.TokenContract.TotalSupply.get
# Code TokenContract.cs line 28: "[Safe] get;"
0018 LDSFLD0
# Code TokenContract.cs line 28: "[Safe] get;"
0019 ISNULL
# Code TokenContract.cs line 28: "[Safe] get;"
0020 JMPIFNOT 17 # pos: 43 (offset: 23)
...
# Method End Neo.SmartContract.Framework.TokenContract.TotalSupply.get
# Code TokenContract.cs line 28: "[Safe] get;"
0043 RET Value of static field 0 is not returned. // AddInstruction(OpCode.DUP);
AddInstruction(OpCode.ISNULL);
// Ensure that no object was sent
Jump(OpCode.JMPIFNOT_L, endTarget); I am wondering if it is correct to write DUP ISNULL JMPIFNOT DROP |
Copied this example "examples/Example.SmartContract.SampleRoyaltyNEP11Token"
I added a method to mint multiple tokens at once like this:
public static void MultiMint(UInt160 to)
{
Mint(to);
Mint(to);
Mint(to);
Mint(to);
}
However when I call this method, the NEO CLI throws "Peak out of bounds..." error
Could someone help identify the cause or suggest a solution?
Is it not possible to mint multiple tokens at once?
The text was updated successfully, but these errors were encountered: