-
Notifications
You must be signed in to change notification settings - Fork 37
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
issues transferring genesis funds #254
Comments
same behaviour for version |
Found the issue.
|
Just looking at the docs, the syntax for transfer is:
In your first example, you had 'Quantity' and 'Asset' reversed, but looks like you fixed it in your second example. |
Its the way the build script is bring made. if someone could help me validate this script. Script: using var sb = new ScriptBuilder();
// balanceOf operation places current balance on eval stack
sb.EmitDynamicCall(asset, "balanceOf", senderHash);
// transfer operation takes 4 arguments, amount is 3rd parameter
// push data parameter onto the stack then switch positions of the top
// two items on eval stack so data is 4th arg and balance is 3rd
sb.EmitPush(data);
sb.Emit(OpCode.SWAP);
sb.EmitPush(receiverHash);
sb.EmitPush(senderHash);
sb.EmitPush(4);
sb.Emit(OpCode.PACK);
sb.EmitPush("transfer");
sb.EmitPush(asset);
sb.EmitSysCall(ApplicationEngine.System_Contract_Call); |
Miss a "CallFlag" parameter. using var sb = new ScriptBuilder();
// balanceOf operation places current balance on eval stack
sb.EmitDynamicCall(asset, "balanceOf", senderHash);
// transfer operation takes 4 arguments, amount is 3rd parameter
// push data parameter onto the stack then switch positions of the top
// two items on eval stack so data is 4th arg and balance is 3rd
sb.EmitPush(data);
sb.Emit(OpCode.SWAP);
sb.EmitPush(receiverHash);
sb.EmitPush(senderHash);
sb.EmitPush(4);
sb.Emit(OpCode.PACK);
sb.EmitPush(CallFlags.All);//here
sb.EmitPush("transfer");
sb.EmitPush(asset);
sb.EmitSysCall(ApplicationEngine.System_Contract_Call); |
@Ashuaidehao @ixje {
"transaction": {
"hash": "0xd84454503f753c73e48c19ea44b0c8e61d0ddc663fa8c3afa7d943a021959f08",
"size": 309,
"version": 0,
"nonce": 1279174231,
"sender": "NgF3kiTq2gSYbFPPjPhtxmV2bYBTBUWaq6",
"sysfee": "12006110",
"netfee": "1292580",
"validuntilblock": 5793,
"signers": [
{
"account": "0xd7a0a7ffee262ab280a8669102ab46517b3bfede",
"scopes": "CalledByEntry"
}
],
"attributes": [],
"script": "DBTe/jt7UUarApFmqICyKibu/6eg1xHAHwwJYmFsYW5jZU9mDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSC1AMFKhh7nmBUaCl5Q8BmSKwnKER+hTxDBTe/jt7UUarApFmqICyKibu/6eg1xTAHwwIdHJhbnNmZXIMFPVj6kC8KD1NDgXEjqMFs/Kgc0DvQWJ9W1I=",
"witnesses": [
{
"invocation": "DEB1qWe0SEGjb2vkpPci2vMbwmOlJE/sUSTqJNvP7dIJPKL15mtx3ZkRqylR3xynIC03R2U7xM51ayleJSRrX0d2",
"verification": "EQwhAiSY7d6PY7PYtaRDsnwe2pax7Wfr+z7tV8e9+rQ9lUt3EUGe0Nw6"
}
]
},
"application-log": {
"txid": "0xd84454503f753c73e48c19ea44b0c8e61d0ddc663fa8c3afa7d943a021959f08",
"executions": [
{
"trigger": "Application",
"vmstate": "HALT",
"gasconsumed": "12006110",
"exception": null,
"stack": [
{
"type": "Boolean",
"value": true
}
],
"notifications": [
{
"contract": "0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5",
"eventname": "Transfer",
"state": {
"type": "Array",
"value": [
{
"type": "ByteString",
"value": "3v47e1FGqwKRZqiAsiom7v+noNc="
},
{
"type": "ByteString",
"value": "qGHueYFRoKXlDwGZIrCcoRH6FPE="
},
{
"type": "Integer",
"value": "100000000"
}
]
}
},
{
"contract": "0xd2a4cff31913016155e38e474a2c06d08be276cf",
"eventname": "Transfer",
"state": {
"type": "Array",
"value": [
{
"type": "Any"
},
{
"type": "ByteString",
"value": "3v47e1FGqwKRZqiAsiom7v+noNc="
},
{
"type": "Integer",
"value": "1700000000"
}
]
}
}
]
}
]
}
} |
what was the command to invoke this? |
|
first attempt
after some googling I found an example which became the inspiration for my second attempt
seems like it is working but, when reading the application log via
show transaction
I get aFAULT
result and no balances movedneo-express file
The text was updated successfully, but these errors were encountered: