Categories
Cryptocurrency Ethereum Mastering Development

Error: Returned error: gas required exceeds allowance (12487794) or always failing transaction

I am trying to use a script which uses web3.js to transfer a specific amount of ERC20 tokens .I have made this script in such a way that if account doesnt has ether value it will try again and again until it gets the ether to pay for the gas . I run the script […]

Categories
Cryptocurrency Ethereum Mastering Development

Transactions stuck at pending on ropsten test net from one day

I am Writing a simple script for ERC20 token transfer method. which sign transaction offline and then submit it to network. Transfer method encoded data : var encoded = await MyContract.methods .transfer(receiver_address, 10); To get nonce of sender account : var nonce = await web3.eth.getTransactionCount( sender_address, "pending" ); To get estimateed Gas of latest block: […]

Categories
Cryptocurrency Ethereum Mastering Development

Unable to store data from IoT in Raspberry Pi to blockchain using Smartcontract, Web3, and Ropsten

I want to transfer data from heartbeat sensor on Raspberry Pi to blockchain. IoT sensor generates data and publishes these data using MQTT protocol using Paho mosquito broker and this step works fine. On Raspberry Pi, there is Web3.py program to subscribe data from sensor using MQTT protocol and connect to Ropsten test network through […]

Categories
CMS Mastering Development Wordpress

setTimeout not working in jquery

Will someone please tell me why the timer isn’t working. Here is my jQuery code. jQuery(document).ready(function($) { var timer = ”; var ajax_url = pin_shop.ajax_url; clearTimeout(timer); timer = setTimeout(function(){ $(“.pincode_search_field”).on(‘keyup’, function() { var pincode_search_field = $(this).val(); var nonce = $(this).data(‘nonce’); $.ajax({ url: ajax_url, type: ‘post’, dataType: ‘json’, data: { ‘action’ : ‘pincode_search_field’, ‘nonce’ : nonce, […]

Categories
CMS Mastering Development Wordpress

ajax response not recieving

Will anyone help me in this regard. My problem is that when I ajax request WordPress, when I log that response in console it shows error/complete not response. jQuery(document).ready(function($) { $(“.pincode_search_field”).on(‘keyup’, function(event) { event.preventDefault(); var ajax_url = pin_shop.ajax_url; var pincode_search_field = $(this).val(); var nonce = $(this).data(‘nonce’); $.ajax({ url: ajax_url, type: ‘POST’, dataType: ‘json’, data: { […]

Categories
CMS Mastering Development Wordpress

Should I encrypt the response that triggers an Ajax action? Is nonce sufficient?

I am trying to write a custom user registration plugin. The plugin has 5 basic functionalities Take form data and create a user using wp_insert_iser Once a user is created, update user meta for additional fields Send Email Send SMS Send to Whatsapp To make the whole process faster I have created 5 ajax actions […]

Categories
Cryptocurrency Development Ethereum

Sending secure transactions using web3.py

An ethereum account I had has been hacked, where whenever I send it, say, 0.1 eth, some evil bot immediately sends 0.0009 eth from that account to a dummy account, and then spends the remaining 0.0991 eth in gas. I’m not sure how they are monetizing that, but clearly, someone has the private key. I […]

Categories
Cryptocurrency Development Ethereum

Using web3.py to send a 0 price gas erc20 transaction

Sorry about the formatting, I’m on mobile I’m trying to push an ERC20 Token transaction with 0 gas price with web3.py. Although when I set the gas price to 0, I get a: {‘code’: -32000, ‘message’: ‘transaction underpriced’} I know 0 gas price transactions are possible because I’ve seen plenty of them. Code: nonce = […]

Categories
Development

WooCommerce Admin Order AJAX Not Getting Any Response?

Update: Issue resolved! The AJAX works but I had the function debug_to_console for testing which echo to the console log. Here is the function: /* This is a function to print data to web browser console ** ** Use debug_to_console( $data ); to print */ function debug_to_console( $data ) { $output = $data; if ( […]