Base64 code for my smart asset works on testnet but script gives a syntax error while creating the real asset. Any ideas? - smartcontracts

I have created a smart asset script on ide.
I can create the smart asset on testnet with the code Base64 from ide. That works fine on testnet.
But when I try to create the real asset, smart asset script form gives "syntax error" for the base64 code. Any ideas?

There is currently a mismatch between the testnet and mainnet results.
Even encoding and decoding a same script 'true' gives different out and input for me.

Related

Why is the 'truffle compile' command failing and how can this be resolved?

I recently started learning Solidity via YouTube. I'm currently trying to code my first ERC-721 token. I'm following this video and got stuck at around minute 25: How to Code a Crypto Collectible: ERC-721 NFT Tutorial (Ethereum)
At this minute he is trying to compile his project using truffle, at least that's what I understand. When I try to compile, I keep getting the following error message:
C:\starter_kit>truffle compile
Error parsing C:/starter_kit/src/contracts/ERC721.sol: ParsedContract.sol:295:42: ParserError: Expected ';' but got '{'
(bool success, ) = recipient.call{value: amount}("");
Compilation failed. See above.
Truffle v5.0.5 (core: 5.0.5)
Node v18.7.0
The file to which the error message is referring, is from this location:
OpenZeppelin / openzeppelin-contracts and is located in the following folder: "openzeppelin-contracts/contracts/token/ERC721/"
The above is what the person who created the tutorial also uses. Although it seems like the video is outdated and the openzeppelin files are more recent, I believe eventually this shouldn't be a problem with some adjustments. However, it will probably have something to do with the error message.
I tried to go into the 'ERC721.sol' file and edit some code, but as I'm only just starting I don't really know where to look at and what to change. Is it possible to help with this? I would really like to continue learning Solidity, as I think there's a future for this.
Any help is very much appreciated! Thank you.
you are using syntax that is for latest solidity version 0.6.0>
use this instead
(bool success, ) = recipient.call.value(amount)("");
Solidity ParserError: Expected ';' but got '{'

EDA playground $dumpfile?

Hello I am having trouble getting some code to run in EDA playground. I keep getting the message:
"No *.vcd file found. EPWave will not open. Did you use '$dumpfile("dump.vcd"); $dumpvars;'?"
but I have it included in the code.
https://www.edaplayground.com/x/2pim
heres the link.
Your problem is that your code does not compile. (There is an error because your design has no port called state.) So, your simulation does not run and so there will be no dump.vcd file.

Enable Transfer Acceleration for AWS SDK for macos

Disclaimer: I posted this originally on Code Review but as the code does not currently work I was suggested to post at SO instead.
I have converted the official AWS SDK iOS (v 2.5.0) framework (focusing on S3) to macOS and everything is working as expected with uploads and downloads. However, I wanted to also enable Transfer Acceleration for S3 using AWSTransferManager. I know that you can enable Transfer Acceleration (TA) using the AWSTransferUtility, but that utility uses pre-signed requests that are valid for only 50 minutes (useful for iOS but not macOS). I would like to be able to transfer files that are large and can take hours even when using Transfer Acceleration.
I have edited the original code from AWS to enable TA for AWSTransferManager, however, I still can not get this to work properly as the final signing of the upload/download request fails. The error message is:
Message=The request signature we calculated does not match the signature you provided. Check your key and signing method.}]
For the most part, I have edited the files AWSSignature, AWSS3TransferManager, and AWSService (AWSServiceConfiguration). I think that the signing error occurs because I am editing a path, or URL without correctly code signing the change (probably in AWSSignature.m). As I am uncertain as to where my code breaks, I have created a repository with all of the AWS SKD macOS files required to compile the framework including a unit test. If I run the test initializing the call to AWSServiceConfiguration with:
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc]initWithRegion:[region aws_regionTypeValue] credentialsProvider:credentialsProvider
accelerateModeEnabled:#(NO)
bucketName:self.testBucketName];
Then everything works as expected and the test file uploads and downloads correctly. However, if I try to turn transfer acceleration on (I have already made sure that my bucket has acceleration enabled), then it fails with the code signing error above.
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc]initWithRegion:[region aws_regionTypeValue] credentialsProvider:credentialsProvider
accelerateModeEnabled:#(YES)
bucketName:self.testBucketName];
In fact it seems like the test script is trying to upload a file much larger than what the testfile (3 Mb) really is. I assume my error is related to the signing of the URL body in some way as the size of the file seems wrong.
I know that finding this error requires a bigger effort than what is usually expected at SO and it is not something many will throw themselves at (but hopefully some) as it involves very complex code and it is time-consuming. However, I do believe that if we could make this work then many can find the framework for AWS SKD for macOS + Transfer Acceleration very useful.
I hope you will take a look at try to identify what may be my problem breaking the code signing.
All code for the framework+test example is available here: https://github.com/trondkr/aws-sdk-macos-TA. To run the unit test you need to provide the secret key and access id to your AWS S3 and the name of a bucket that has transfer acceleration enabled.
Thanks. Cheers, Trond

UrlFetchApp.fetch stopped working on Monday the 7th after no issues for months with two api's

Any one else see the following problem.
I use zendesk API and pipeline deals api.
code has been in use for 2 months (no issues all working)
As of this week (no changes to the code) both API's fail on post with create calls (Gets work fine and authentication also working fine for both API's).
The execution log shows correct data being encoded example below (removed actual values)
UrlFetchApp.fetch([https://supernahelp.zendesk.com/api/v2/organizations.json, {headers={Authorization=Basic someencodedauthdata, Content-Type=application/json}, method=post, payload={"organization":{"name":"somecustomer","domain_names":"xyc.edu","organization_fields":{"supernauniqueid":"Sup-2308233814","crmdashboard":"someurladdedhere"}}}, muteHttpExceptions=true}])
The payload was passed through JSON.stringify to add to API call and has been working fine for ever.
Error return to from execution log "call to make to ZD {"error":"RecordInvalid","description":"Record validation errors","details":{"name":[{"description":"Name: cannot be blank","error":"BlankValue"}"
Which basically means API could not parse the body correctly for the name value which was sent
I opened case with Zendesk and they got there logs and showed me what they received (not the same record)
only a snippet
{"{\"organization\":{\"name\":\"customer name here \"
I noticed \ added to the payload (not by my code) but this was added by GAS.
AND
Pipeline API has same issue payload Post commands are rejected with bad payload.
Both failed on the same day, and no longer work at all.
this tells me others must have issue with post commands?
looking for help as code worked fine and then stopped and it looks like GAS is adding escape codes out of the blue
Andrew
GAS was broken, seems content type encoding into headers stopped working and moving the content type ad syntax was changed (broke many others scripts as well).
https://code.google.com/p/google-apps-script-issues/issues/detail?id=5585&can=6&colspec=Stars%20Opened%20ID%20Type%20Status%20Summary%20Component%20Owner
Andrew

How to get Yii2 formatted error message in production systems?

When Yii2 is used in debug mode and an error occurs, it shows a error message along with call trace, session, cookie and server info.
Sample image shown below.
In production ready systems, this will not be shown. However, Is there a way to pull this formatted html into a variable in production systems, so that it can be emailed to the developer to ease in debugging errors. If any one has any idea, please let me know.
I tried using \Yii::$app->mailer->render() passing #vendor/yiisoft/yii2/views/errorHandler/exception.php as view, ['exception => $ex] as data, layout file as parameters. I'm getting undefined variable handler error.
Config Log Targets for your purpose:
http://www.yiiframework.com/doc-2.0/guide-runtime-logging.html