To interact with smart contract without gasprice - blockchain

I am using web3j java library to deploy and to interact with the smart contract. When I tried to send a transaction that invoke a function in smart contract by setting the gas price to 0 and gas limit to DefaultGasProvider.GAS_LIMIT. I am getting the below exception.
How to fix this issue?
With Remix and MetaMask it works without any issue. What am I missing when using web3j, any pointers would be of great help.
org.web3j.protocol.exceptions.TransactionException: Transaction has failed with status: 0x0. Gas used: 4300000. (not-enough gas?)

Only solidity ^0.4.25 supports sending transactions with gas price 0.

Related

Not able to correctly send a transaction - BSC Testnet & Web3

After countless trials, I'm not able to send a transaction using the BSC tesntet, Web3 js and Metamask (I also tried with the Binance wallet).
It seems that everything works, but when I deploy the transaction I get errors like "nonce too low", "transaction underprices" and it doesn't matter if I manually change the nonce, gasLimit and price, and the amount to spend.
Any idea? Do you know if there is any working example or did you experience similar issue?
Any help/comment/suggestion is appreciated! Thank you in advance!
Used Binance testnet and web3 to code, sign and send a trasnaction --> I got several errors like "transaction underpriced", "nonce too low"

Calling smart contract function to send ether to another address does not work when contract is deployed to hyperledger-besu

I have deployed a local hyperledger-besu test net and used truffle to migrate a very simple contract on the network. SimpleContract
I have prefunded some accounts so that I can interact with the contract. My genesis file is genesisFile
All the functions of the contract work well. However, when invoking the sendPayment function, I get an error errorImage
Here is the font end code I use to invoke the function codeImage
Please guide me on this. What am I doing wrong with the contract?

How to deploy a smartcontract and make a transfer from it in Everscale blockchain

I found this quickstart guide on how to do it locally. But there is no information about on how I can deploy my smartcontract to devnet or mainnet.
So I changed endpoint:
const client = new TonClient({
network: {
endpoints: ["https://net.ton.dev"]
}
})
According to comment, I removed useGiver:
// Request contract deployment funds form a local TON OS SE giver
// not suitable for other networks.
// Deploy `hello` contract.
await helloAcc.deploy(/*{ useGiver: true }*/);
And got this this error message:
Account does not exist. You need to transfer funds to this account first to have a positive balance and then deploy its code
How do I fund my account, is there any automatic method like airdrop?
We added a couple of guides about how to deploy and configure your own giver in developer network. Please, check them out:
Work with devnet with everdev tool - https://github.com/tonlabs/everdev/blob/main/docs/work_with_devnet.md
Configure giver in AppKit - https://tonlabs.gitbook.io/appkit-js/guides/custom_giver
You need to first calculate the contract address in the target chain and then tip it up to 1 EVER for deployment to succeed.
The amount of gas needed depends on the code of the contract, but cannot exceed 1 EVER.
There are no automatic givers in net.ton.dev now. But you can get rubins from here: faucet.extraton.io Also you can create automatic giver in this test network by yourself.

Creation of my_smart_contract pending in Remix

I have been trying to deploy my first contract on Remix using Ropsten Network with metamask but i am always seeing this
Creation of my_smart_contract pending
Please how can i resolve this
I think the error will because of EIther you haven't changed the deployed option to web3 provider or You haven;t changed the Port to 7545. Please check , i face the same issue
Make sure to compile the contract before deploying. Image for reference

I am not able to register new ENS name in Ethereum Name Service

I am using JS library Web3 JS
My aim is to register a new ENS name like "demo1234.eth" on Ropsten Test Network
I tried
setResolver
web3.eth.ens.setResolver('demo1234.eth', '0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63',{from:'0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63'}, (data)=>{console.log(data)});
setOwner
web3.eth.ens.setOwner('demo1234.eth', {from:'0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63'}, (data)=>{console.log(data)});
setAddress
web3.eth.ens.setAddress('demo1234.eth','0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63', {from:'0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63'}, (data)=>{console.log(data)});
setRecord
web3.eth.ens.setRecord('demo1234.eth','0x283Af0B28c62C092C9727F1Ee09c02CA627EB7F5 ','0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63',3600 {from:'0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63'}, (data)=>{console.log(data)});
I am able to do send transaction to metamask wallet and after approval given to transaction it get failed after some time i am getting same error
Warning! Error encountered during contract execution [Reverted]
reference
even I tried to deploy a similar contract I found here
I am getting same error .
I have my wallet 0xBDA997B9532ce5e98CF7090f87f24dC11bb42F63 on Ropsten Test Nework ,Even I have enough balance in my wallet (approx 8.4 eth)
please if any one know how can I successfully register new ENS name on test net How I registered on ens.domain
please guys help me if you can ... and
thank you so much in advance